<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head><link rel="stylesheet" type="text/css" href="style.css" /><script type="text/javascript" src="highlight.js"></script></head><body><pre><span class="hs-pragma">{-# LANGUAGE CPP #-}</span><span>
</span><span id="line-2"></span><span>
</span><span id="line-3"></span><span class="hs-keyword">module</span><span> </span><span class="hs-identifier">GHC.Core.TyCo.FVs</span><span>
</span><span id="line-4"></span><span>  </span><span class="hs-special">(</span><span>     </span><span class="annot"><a href="GHC.Core.TyCo.FVs.html#shallowTyCoVarsOfType"><span class="hs-identifier">shallowTyCoVarsOfType</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Core.TyCo.FVs.html#shallowTyCoVarsOfTypes"><span class="hs-identifier">shallowTyCoVarsOfTypes</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-5"></span><span>        </span><span class="annot"><a href="GHC.Core.TyCo.FVs.html#tyCoVarsOfType"><span class="hs-identifier">tyCoVarsOfType</span></a></span><span class="hs-special">,</span><span>        </span><span class="annot"><a href="GHC.Core.TyCo.FVs.html#tyCoVarsOfTypes"><span class="hs-identifier">tyCoVarsOfTypes</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-6"></span><span>        </span><span class="annot"><a href="GHC.Core.TyCo.FVs.html#tyCoVarsOfTypeDSet"><span class="hs-identifier">tyCoVarsOfTypeDSet</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Core.TyCo.FVs.html#tyCoVarsOfTypesDSet"><span class="hs-identifier">tyCoVarsOfTypesDSet</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-7"></span><span>
</span><span id="line-8"></span><span>        </span><span class="annot"><a href="GHC.Core.TyCo.FVs.html#tyCoFVsBndr"><span class="hs-identifier">tyCoFVsBndr</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Core.TyCo.FVs.html#tyCoFVsVarBndr"><span class="hs-identifier">tyCoFVsVarBndr</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Core.TyCo.FVs.html#tyCoFVsVarBndrs"><span class="hs-identifier">tyCoFVsVarBndrs</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-9"></span><span>        </span><span class="annot"><a href="GHC.Core.TyCo.FVs.html#tyCoFVsOfType"><span class="hs-identifier">tyCoFVsOfType</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Core.TyCo.FVs.html#tyCoVarsOfTypeList"><span class="hs-identifier">tyCoVarsOfTypeList</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-10"></span><span>        </span><span class="annot"><a href="GHC.Core.TyCo.FVs.html#tyCoFVsOfTypes"><span class="hs-identifier">tyCoFVsOfTypes</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Core.TyCo.FVs.html#tyCoVarsOfTypesList"><span class="hs-identifier">tyCoVarsOfTypesList</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-11"></span><span>        </span><span class="annot"><a href="GHC.Core.TyCo.FVs.html#deepTcvFolder"><span class="hs-identifier">deepTcvFolder</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-12"></span><span>
</span><span id="line-13"></span><span>        </span><span class="annot"><a href="GHC.Core.TyCo.FVs.html#shallowTyCoVarsOfTyVarEnv"><span class="hs-identifier">shallowTyCoVarsOfTyVarEnv</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Core.TyCo.FVs.html#shallowTyCoVarsOfCoVarEnv"><span class="hs-identifier">shallowTyCoVarsOfCoVarEnv</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-14"></span><span>
</span><span id="line-15"></span><span>        </span><span class="annot"><a href="GHC.Core.TyCo.FVs.html#shallowTyCoVarsOfCo"><span class="hs-identifier">shallowTyCoVarsOfCo</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Core.TyCo.FVs.html#shallowTyCoVarsOfCos"><span class="hs-identifier">shallowTyCoVarsOfCos</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-16"></span><span>        </span><span class="annot"><a href="GHC.Core.TyCo.FVs.html#tyCoVarsOfCo"><span class="hs-identifier">tyCoVarsOfCo</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Core.TyCo.FVs.html#tyCoVarsOfCos"><span class="hs-identifier">tyCoVarsOfCos</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Core.TyCo.FVs.html#tyCoVarsOfMCo"><span class="hs-identifier">tyCoVarsOfMCo</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-17"></span><span>        </span><span class="annot"><a href="GHC.Core.TyCo.FVs.html#coVarsOfType"><span class="hs-identifier">coVarsOfType</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Core.TyCo.FVs.html#coVarsOfTypes"><span class="hs-identifier">coVarsOfTypes</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-18"></span><span>        </span><span class="annot"><a href="GHC.Core.TyCo.FVs.html#coVarsOfCo"><span class="hs-identifier">coVarsOfCo</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Core.TyCo.FVs.html#coVarsOfCos"><span class="hs-identifier">coVarsOfCos</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-19"></span><span>        </span><span class="annot"><a href="GHC.Core.TyCo.FVs.html#tyCoVarsOfCoDSet"><span class="hs-identifier">tyCoVarsOfCoDSet</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-20"></span><span>        </span><span class="annot"><a href="GHC.Core.TyCo.FVs.html#tyCoFVsOfCo"><span class="hs-identifier">tyCoFVsOfCo</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Core.TyCo.FVs.html#tyCoFVsOfCos"><span class="hs-identifier">tyCoFVsOfCos</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-21"></span><span>        </span><span class="annot"><a href="GHC.Core.TyCo.FVs.html#tyCoVarsOfCoList"><span class="hs-identifier">tyCoVarsOfCoList</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-22"></span><span>
</span><span id="line-23"></span><span>        </span><span class="annot"><a href="GHC.Core.TyCo.FVs.html#almostDevoidCoVarOfCo"><span class="hs-identifier">almostDevoidCoVarOfCo</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-24"></span><span>
</span><span id="line-25"></span><span>        </span><span class="hs-comment">-- Injective free vars</span><span>
</span><span id="line-26"></span><span>        </span><span class="annot"><a href="GHC.Core.TyCo.FVs.html#injectiveVarsOfType"><span class="hs-identifier">injectiveVarsOfType</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Core.TyCo.FVs.html#injectiveVarsOfTypes"><span class="hs-identifier">injectiveVarsOfTypes</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-27"></span><span>        </span><span class="annot"><a href="GHC.Core.TyCo.FVs.html#invisibleVarsOfType"><span class="hs-identifier">invisibleVarsOfType</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Core.TyCo.FVs.html#invisibleVarsOfTypes"><span class="hs-identifier">invisibleVarsOfTypes</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-28"></span><span>
</span><span id="line-29"></span><span>        </span><span class="hs-comment">-- No Free vars</span><span>
</span><span id="line-30"></span><span>        </span><span class="annot"><a href="GHC.Core.TyCo.FVs.html#noFreeVarsOfType"><span class="hs-identifier">noFreeVarsOfType</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Core.TyCo.FVs.html#noFreeVarsOfTypes"><span class="hs-identifier">noFreeVarsOfTypes</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Core.TyCo.FVs.html#noFreeVarsOfCo"><span class="hs-identifier">noFreeVarsOfCo</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-31"></span><span>
</span><span id="line-32"></span><span>        </span><span class="annot"><span class="hs-comment">-- * Well-scoped free variables</span></span><span>
</span><span id="line-33"></span><span>        </span><span class="annot"><a href="GHC.Core.TyCo.FVs.html#scopedSort"><span class="hs-identifier">scopedSort</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Core.TyCo.FVs.html#tyCoVarsOfTypeWellScoped"><span class="hs-identifier">tyCoVarsOfTypeWellScoped</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-34"></span><span>        </span><span class="annot"><a href="GHC.Core.TyCo.FVs.html#tyCoVarsOfTypesWellScoped"><span class="hs-identifier">tyCoVarsOfTypesWellScoped</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-35"></span><span>
</span><span id="line-36"></span><span>        </span><span class="annot"><span class="hs-comment">-- * Closing over kinds</span></span><span>
</span><span id="line-37"></span><span>        </span><span class="annot"><a href="GHC.Core.TyCo.FVs.html#closeOverKindsDSet"><span class="hs-identifier">closeOverKindsDSet</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Core.TyCo.FVs.html#closeOverKindsList"><span class="hs-identifier">closeOverKindsList</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-38"></span><span>        </span><span class="annot"><a href="GHC.Core.TyCo.FVs.html#closeOverKinds"><span class="hs-identifier">closeOverKinds</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-39"></span><span>
</span><span id="line-40"></span><span>        </span><span class="annot"><span class="hs-comment">-- * Raw materials</span></span><span>
</span><span id="line-41"></span><span>        </span><span class="annot"><a href="../../base/src/Data.Semigroup.Internal.html#Endo"><span class="hs-identifier">Endo</span></a></span><span class="hs-special">(</span><span class="hs-glyph">..</span><span class="hs-special">)</span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Core.TyCo.FVs.html#runTyCoVars"><span class="hs-identifier">runTyCoVars</span></a></span><span>
</span><span id="line-42"></span><span>  </span><span class="hs-special">)</span><span> </span><span class="hs-keyword">where</span><span class="hs-cpp">

#include &quot;HsVersions.h&quot;
</span><span>
</span><span id="line-46"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Prelude.html"><span class="hs-identifier">GHC.Prelude</span></a></span><span>
</span><span id="line-47"></span><span>
</span><span id="line-48"></span><span class="hs-keyword">import</span><span> </span><span class="hs-pragma">{-# SOURCE</span><span> </span><span class="hs-pragma">#-}</span><span> </span><span class="annot"><a href="GHC.Core.Type.html"><span class="hs-identifier">GHC.Core.Type</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Core.Type.html#coreView"><span class="hs-identifier">coreView</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Core.Type.html#partitionInvisibleTypes"><span class="hs-identifier">partitionInvisibleTypes</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-49"></span><span>
</span><span id="line-50"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="../../base/src/Data.Monoid.html#"><span class="hs-identifier">Data.Monoid</span></a></span><span> </span><span class="hs-keyword">as</span><span> </span><span class="annot"><span class="hs-identifier">DM</span></span><span> </span><span class="hs-special">(</span><span> </span><span class="annot"><a href="../../base/src/Data.Semigroup.Internal.html#Endo"><span class="hs-identifier">Endo</span></a></span><span class="hs-special">(</span><span class="hs-glyph">..</span><span class="hs-special">)</span><span class="hs-special">,</span><span> </span><span class="annot"><a href="../../base/src/Data.Semigroup.Internal.html#All"><span class="hs-identifier">All</span></a></span><span class="hs-special">(</span><span class="hs-glyph">..</span><span class="hs-special">)</span><span> </span><span class="hs-special">)</span><span>
</span><span id="line-51"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Core.TyCo.Rep.html"><span class="hs-identifier">GHC.Core.TyCo.Rep</span></a></span><span>
</span><span id="line-52"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Core.TyCon.html"><span class="hs-identifier">GHC.Core.TyCon</span></a></span><span>
</span><span id="line-53"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Types.Var.html"><span class="hs-identifier">GHC.Types.Var</span></a></span><span>
</span><span id="line-54"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Utils.FV.html"><span class="hs-identifier">GHC.Utils.FV</span></a></span><span>
</span><span id="line-55"></span><span>
</span><span id="line-56"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Types.Unique.FM.html"><span class="hs-identifier">GHC.Types.Unique.FM</span></a></span><span>
</span><span id="line-57"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Types.Var.Set.html"><span class="hs-identifier">GHC.Types.Var.Set</span></a></span><span>
</span><span id="line-58"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Types.Var.Env.html"><span class="hs-identifier">GHC.Types.Var.Env</span></a></span><span>
</span><span id="line-59"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Utils.Misc.html"><span class="hs-identifier">GHC.Utils.Misc</span></a></span><span>
</span><span id="line-60"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Utils.Panic.html"><span class="hs-identifier">GHC.Utils.Panic</span></a></span><span>
</span><span id="line-61"></span><span>
</span><span id="line-62"></span><span class="hs-comment">{-
%************************************************************************
%*                                                                      *
                 Free variables of types and coercions
%*                                                                      *
%************************************************************************
-}</span><span>
</span><span id="line-69"></span><span>
</span><span id="line-70"></span><span class="hs-comment">{- Note [Shallow and deep free variables]
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Definitions

* Shallow free variables of a type: the variables
  affected by substitution. Specifically, the (TyVarTy tv)
  and (CoVar cv) that appear
    - In the type and coercions appearing in the type
    - In shallow free variables of the kind of a Forall binder
  but NOT in the kind of the /occurrences/ of a type variable.

* Deep free variables of a type: shallow free variables, plus
  the deep free variables of the kinds of those variables.
  That is,  deepFVs( t ) = closeOverKinds( shallowFVs( t ) )

Examples:

  Type                     Shallow     Deep
  ---------------------------------
  (a : (k:Type))           {a}        {a,k}
  forall (a:(k:Type)). a   {k}        {k}
  (a:k-&gt;Type) (b:k)        {a,b}      {a,b,k}
-}</span><span>
</span><span id="line-93"></span><span>
</span><span id="line-94"></span><span>
</span><span id="line-95"></span><span class="hs-comment">{- Note [Free variables of types]
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
The family of functions tyCoVarsOfType, tyCoVarsOfTypes etc, returns
a VarSet that is closed over the types of its variables.  More precisely,
  if    S = tyCoVarsOfType( t )
  and   (a:k) is in S
  then  tyCoVarsOftype( k ) is a subset of S

Example: The tyCoVars of this ((a:* -&gt; k) Int) is {a, k}.

We could /not/ close over the kinds of the variable occurrences, and
instead do so at call sites, but it seems that we always want to do
so, so it's easiest to do it here.

It turns out that getting the free variables of types is performance critical,
so we profiled several versions, exploring different implementation strategies.

1. Baseline version: uses FV naively. Essentially:

   tyCoVarsOfType ty = fvVarSet $ tyCoFVsOfType ty

   This is not nice, because FV introduces some overhead to implement
   determinism, and through its &quot;interesting var&quot; function, neither of which
   we need here, so they are a complete waste.

2. UnionVarSet version: instead of reusing the FV-based code, we simply used
   VarSets directly, trying to avoid the overhead of FV. E.g.:

   -- FV version:
   tyCoFVsOfType (AppTy fun arg)    a b c = (tyCoFVsOfType fun `unionFV` tyCoFVsOfType arg) a b c

   -- UnionVarSet version:
   tyCoVarsOfType (AppTy fun arg)    = (tyCoVarsOfType fun `unionVarSet` tyCoVarsOfType arg)

   This looks deceptively similar, but while FV internally builds a list- and
   set-generating function, the VarSet functions manipulate sets directly, and
   the latter performs a lot worse than the naive FV version.

3. Accumulator-style VarSet version: this is what we use now. We do use VarSet
   as our data structure, but delegate the actual work to a new
   ty_co_vars_of_...  family of functions, which use accumulator style and the
   &quot;in-scope set&quot; filter found in the internals of FV, but without the
   determinism overhead.

See #14880.

Note [Closing over free variable kinds]
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
tyCoVarsOfType and tyCoFVsOfType, while traversing a type, will also close over
free variable kinds. In previous GHC versions, this happened naively: whenever
we would encounter an occurrence of a free type variable, we would close over
its kind. This, however is wrong for two reasons (see #14880):

1. Efficiency. If we have Proxy (a::k) -&gt; Proxy (a::k) -&gt; Proxy (a::k), then
   we don't want to have to traverse k more than once.

2. Correctness. Imagine we have forall k. b -&gt; k, where b has
   kind k, for some k bound in an outer scope. If we look at b's kind inside
   the forall, we'll collect that k is free and then remove k from the set of
   free variables. This is plain wrong. We must instead compute that b is free
   and then conclude that b's kind is free.

An obvious first approach is to move the closing-over-kinds from the
occurrences of a type variable to after finding the free vars - however, this
turns out to introduce performance regressions, and isn't even entirely
correct.

In fact, it isn't even important *when* we close over kinds; what matters is
that we handle each type var exactly once, and that we do it in the right
context.

So the next approach we tried was to use the &quot;in-scope set&quot; part of FV or the
equivalent argument in the accumulator-style `ty_co_vars_of_type` function, to
say &quot;don't bother with variables we have already closed over&quot;. This should work
fine in theory, but the code is complicated and doesn't perform well.

But there is a simpler way, which is implemented here. Consider the two points
above:

1. Efficiency: we now have an accumulator, so the second time we encounter 'a',
   we'll ignore it, certainly not looking at its kind - this is why
   pre-checking set membership before inserting ends up not only being faster,
   but also being correct.

2. Correctness: we have an &quot;in-scope set&quot; (I think we should call it it a
  &quot;bound-var set&quot;), specifying variables that are bound by a forall in the type
  we are traversing; we simply ignore these variables, certainly not looking at
  their kind.

So now consider:

    forall k. b -&gt; k

where b :: k-&gt;Type is free; but of course, it's a different k! When looking at
b -&gt; k we'll have k in the bound-var set. So we'll ignore the k. But suppose
this is our first encounter with b; we want the free vars of its kind. But we
want to behave as if we took the free vars of its kind at the end; that is,
with no bound vars in scope.

So the solution is easy. The old code was this:

  ty_co_vars_of_type (TyVarTy v) is acc
    | v `elemVarSet` is  = acc
    | v `elemVarSet` acc = acc
    | otherwise          = ty_co_vars_of_type (tyVarKind v) is (extendVarSet acc v)

Now all we need to do is take the free vars of tyVarKind v *with an empty
bound-var set*, thus:

ty_co_vars_of_type (TyVarTy v) is acc
  | v `elemVarSet` is  = acc
  | v `elemVarSet` acc = acc
  | otherwise          = ty_co_vars_of_type (tyVarKind v) emptyVarSet (extendVarSet acc v)
                                                          ^^^^^^^^^^^

And that's it. This works because a variable is either bound or free. If it is bound,
then we won't look at it at all. If it is free, then all the variables free in its
kind are free -- regardless of whether some local variable has the same Unique.
So if we're looking at a variable occurrence at all, then all variables in its
kind are free.
-}</span><span>
</span><span id="line-216"></span><span>
</span><span id="line-217"></span><span class="hs-comment">{- *********************************************************************
*                                                                      *
          Endo for free variables
*                                                                      *
********************************************************************* -}</span><span>
</span><span id="line-222"></span><span>
</span><span id="line-223"></span><span class="hs-comment">{- Note [Acumulating parameter free variables]
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
We can use foldType to build an accumulating-parameter version of a
free-var finder, thus:

    fvs :: Type -&gt; TyCoVarSet
    fvs ty = appEndo (foldType folder ty) emptyVarSet

Recall that
    foldType :: TyCoFolder env a -&gt; env -&gt; Type -&gt; a

    newtype Endo a = Endo (a -&gt; a)   -- In Data.Monoid
    instance Monoid a =&gt; Monoid (Endo a) where
       (Endo f) `mappend` (Endo g) = Endo (f.g)

    appEndo :: Endo a -&gt; a -&gt; a
    appEndo (Endo f) x = f x

So `mappend` for Endos is just function composition.

It's very important that, after optimisation, we end up with
* an arity-three function
* that is strict in the accumulator

   fvs env (TyVarTy v) acc
      | v `elemVarSet` env = acc
      | v `elemVarSet` acc = acc
      | otherwise          = acc `extendVarSet` v
   fvs env (AppTy t1 t2)   = fvs env t1 (fvs env t2 acc)
   ...

The &quot;strict in the accumulator&quot; part is to ensure that in the
AppTy equation we don't build a thunk for (fvs env t2 acc).

The optimiser does do all this, but not very robustly. It depends
critially on the basic arity-2 function not being exported, so that
all its calls are visibly to three arguments. This analysis is
done by the Call Arity pass.

TL;DR: check this regularly!
-}</span><span>
</span><span id="line-264"></span><span>
</span><span id="line-265"></span><span class="annot"><a href="GHC.Core.TyCo.FVs.html#runTyCoVars"><span class="hs-identifier hs-type">runTyCoVars</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="../../base/src/Data.Semigroup.Internal.html#Endo"><span class="hs-identifier hs-type">Endo</span></a></span><span> </span><span class="annot"><a href="GHC.Types.Var.Set.html#TyCoVarSet"><span class="hs-identifier hs-type">TyCoVarSet</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Types.Var.Set.html#TyCoVarSet"><span class="hs-identifier hs-type">TyCoVarSet</span></a></span><span>
</span><span id="line-266"></span><span class="hs-pragma">{-# INLINE</span><span> </span><span class="annot"><a href="GHC.Core.TyCo.FVs.html#runTyCoVars"><span class="hs-pragma hs-type">runTyCoVars</span></a></span><span> </span><span class="hs-pragma">#-}</span><span>
</span><span id="line-267"></span><span id="runTyCoVars"><span class="annot"><span class="annottext">runTyCoVars :: Endo VarSet -&gt; VarSet
</span><a href="GHC.Core.TyCo.FVs.html#runTyCoVars"><span class="hs-identifier hs-var hs-var">runTyCoVars</span></a></span></span><span> </span><span id="local-6989586621680848134"><span class="annot"><span class="annottext">Endo VarSet
</span><a href="#local-6989586621680848134"><span class="hs-identifier hs-var">f</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Endo VarSet -&gt; VarSet -&gt; VarSet
forall a. Endo a -&gt; a -&gt; a
</span><a href="../../base/src/Data.Semigroup.Internal.html#appEndo"><span class="hs-identifier hs-var hs-var">appEndo</span></a></span><span> </span><span class="annot"><span class="annottext">Endo VarSet
</span><a href="#local-6989586621680848134"><span class="hs-identifier hs-var">f</span></a></span><span> </span><span class="annot"><span class="annottext">VarSet
</span><a href="GHC.Types.Var.Set.html#emptyVarSet"><span class="hs-identifier hs-var">emptyVarSet</span></a></span><span>
</span><span id="line-268"></span><span>
</span><span id="line-269"></span><span class="annot"><a href="GHC.Core.TyCo.FVs.html#noView"><span class="hs-identifier hs-type">noView</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Core.TyCo.Rep.html#Type"><span class="hs-identifier hs-type">Type</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="../../base/src/GHC.Maybe.html#Maybe"><span class="hs-identifier hs-type">Maybe</span></a></span><span> </span><span class="annot"><a href="GHC.Core.TyCo.Rep.html#Type"><span class="hs-identifier hs-type">Type</span></a></span><span>
</span><span id="line-270"></span><span id="noView"><span class="annot"><span class="annottext">noView :: Type -&gt; Maybe Type
</span><a href="GHC.Core.TyCo.FVs.html#noView"><span class="hs-identifier hs-var hs-var">noView</span></a></span></span><span> </span><span class="annot"><span class="annottext">Type
</span><span class="hs-identifier">_</span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Maybe Type
forall a. Maybe a
</span><a href="../../base/src/GHC.Maybe.html#Nothing"><span class="hs-identifier hs-var">Nothing</span></a></span><span>
</span><span id="line-271"></span><span>
</span><span id="line-272"></span><span class="hs-comment">{- *********************************************************************
*                                                                      *
          Deep free variables
          See Note [Shallow and deep free variables]
*                                                                      *
********************************************************************* -}</span><span>
</span><span id="line-278"></span><span>
</span><span id="line-279"></span><span class="annot"><a href="GHC.Core.TyCo.FVs.html#tyCoVarsOfType"><span class="hs-identifier hs-type">tyCoVarsOfType</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Core.TyCo.Rep.html#Type"><span class="hs-identifier hs-type">Type</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Types.Var.Set.html#TyCoVarSet"><span class="hs-identifier hs-type">TyCoVarSet</span></a></span><span>
</span><span id="line-280"></span><span id="tyCoVarsOfType"><span class="annot"><span class="annottext">tyCoVarsOfType :: Type -&gt; VarSet
</span><a href="GHC.Core.TyCo.FVs.html#tyCoVarsOfType"><span class="hs-identifier hs-var hs-var">tyCoVarsOfType</span></a></span></span><span> </span><span id="local-6989586621680848130"><span class="annot"><span class="annottext">Type
</span><a href="#local-6989586621680848130"><span class="hs-identifier hs-var">ty</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Endo VarSet -&gt; VarSet
</span><a href="GHC.Core.TyCo.FVs.html#runTyCoVars"><span class="hs-identifier hs-var">runTyCoVars</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Type -&gt; Endo VarSet
</span><a href="GHC.Core.TyCo.FVs.html#deep_ty"><span class="hs-identifier hs-var">deep_ty</span></a></span><span> </span><span class="annot"><span class="annottext">Type
</span><a href="#local-6989586621680848130"><span class="hs-identifier hs-var">ty</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-281"></span><span class="hs-comment">-- Alternative:</span><span>
</span><span id="line-282"></span><span class="hs-comment">--   tyCoVarsOfType ty = closeOverKinds (shallowTyCoVarsOfType ty)</span><span>
</span><span id="line-283"></span><span>
</span><span id="line-284"></span><span class="annot"><a href="GHC.Core.TyCo.FVs.html#tyCoVarsOfTypes"><span class="hs-identifier hs-type">tyCoVarsOfTypes</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="hs-special">[</span><span class="annot"><a href="GHC.Core.TyCo.Rep.html#Type"><span class="hs-identifier hs-type">Type</span></a></span><span class="hs-special">]</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Types.Var.Set.html#TyCoVarSet"><span class="hs-identifier hs-type">TyCoVarSet</span></a></span><span>
</span><span id="line-285"></span><span id="tyCoVarsOfTypes"><span class="annot"><span class="annottext">tyCoVarsOfTypes :: [Type] -&gt; VarSet
</span><a href="GHC.Core.TyCo.FVs.html#tyCoVarsOfTypes"><span class="hs-identifier hs-var hs-var">tyCoVarsOfTypes</span></a></span></span><span> </span><span id="local-6989586621680848128"><span class="annot"><span class="annottext">[Type]
</span><a href="#local-6989586621680848128"><span class="hs-identifier hs-var">tys</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Endo VarSet -&gt; VarSet
</span><a href="GHC.Core.TyCo.FVs.html#runTyCoVars"><span class="hs-identifier hs-var">runTyCoVars</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">[Type] -&gt; Endo VarSet
</span><a href="GHC.Core.TyCo.FVs.html#deep_tys"><span class="hs-identifier hs-var">deep_tys</span></a></span><span> </span><span class="annot"><span class="annottext">[Type]
</span><a href="#local-6989586621680848128"><span class="hs-identifier hs-var">tys</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-286"></span><span class="hs-comment">-- Alternative:</span><span>
</span><span id="line-287"></span><span class="hs-comment">--   tyCoVarsOfTypes tys = closeOverKinds (shallowTyCoVarsOfTypes tys)</span><span>
</span><span id="line-288"></span><span>
</span><span id="line-289"></span><span class="annot"><a href="GHC.Core.TyCo.FVs.html#tyCoVarsOfCo"><span class="hs-identifier hs-type">tyCoVarsOfCo</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Core.TyCo.Rep.html#Coercion"><span class="hs-identifier hs-type">Coercion</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Types.Var.Set.html#TyCoVarSet"><span class="hs-identifier hs-type">TyCoVarSet</span></a></span><span>
</span><span id="line-290"></span><span class="hs-comment">-- See Note [Free variables of Coercions]</span><span>
</span><span id="line-291"></span><span id="tyCoVarsOfCo"><span class="annot"><span class="annottext">tyCoVarsOfCo :: Coercion -&gt; VarSet
</span><a href="GHC.Core.TyCo.FVs.html#tyCoVarsOfCo"><span class="hs-identifier hs-var hs-var">tyCoVarsOfCo</span></a></span></span><span> </span><span id="local-6989586621680848126"><span class="annot"><span class="annottext">Coercion
</span><a href="#local-6989586621680848126"><span class="hs-identifier hs-var">co</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Endo VarSet -&gt; VarSet
</span><a href="GHC.Core.TyCo.FVs.html#runTyCoVars"><span class="hs-identifier hs-var">runTyCoVars</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Coercion -&gt; Endo VarSet
</span><a href="GHC.Core.TyCo.FVs.html#deep_co"><span class="hs-identifier hs-var">deep_co</span></a></span><span> </span><span class="annot"><span class="annottext">Coercion
</span><a href="#local-6989586621680848126"><span class="hs-identifier hs-var">co</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-292"></span><span>
</span><span id="line-293"></span><span class="annot"><a href="GHC.Core.TyCo.FVs.html#tyCoVarsOfMCo"><span class="hs-identifier hs-type">tyCoVarsOfMCo</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Core.TyCo.Rep.html#MCoercion"><span class="hs-identifier hs-type">MCoercion</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Types.Var.Set.html#TyCoVarSet"><span class="hs-identifier hs-type">TyCoVarSet</span></a></span><span>
</span><span id="line-294"></span><span id="tyCoVarsOfMCo"><span class="annot"><span class="annottext">tyCoVarsOfMCo :: MCoercion -&gt; VarSet
</span><a href="GHC.Core.TyCo.FVs.html#tyCoVarsOfMCo"><span class="hs-identifier hs-var hs-var">tyCoVarsOfMCo</span></a></span></span><span> </span><span class="annot"><span class="annottext">MCoercion
</span><a href="GHC.Core.TyCo.Rep.html#MRefl"><span class="hs-identifier hs-var">MRefl</span></a></span><span>    </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">VarSet
</span><a href="GHC.Types.Var.Set.html#emptyVarSet"><span class="hs-identifier hs-var">emptyVarSet</span></a></span><span>
</span><span id="line-295"></span><span class="annot"><a href="GHC.Core.TyCo.FVs.html#tyCoVarsOfMCo"><span class="hs-identifier hs-var">tyCoVarsOfMCo</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Core.TyCo.Rep.html#MCo"><span class="hs-identifier hs-type">MCo</span></a></span><span> </span><span id="local-6989586621680848122"><span class="annot"><span class="annottext">Coercion
</span><a href="#local-6989586621680848122"><span class="hs-identifier hs-var">co</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Coercion -&gt; VarSet
</span><a href="GHC.Core.TyCo.FVs.html#tyCoVarsOfCo"><span class="hs-identifier hs-var">tyCoVarsOfCo</span></a></span><span> </span><span class="annot"><span class="annottext">Coercion
</span><a href="#local-6989586621680848122"><span class="hs-identifier hs-var">co</span></a></span><span>
</span><span id="line-296"></span><span>
</span><span id="line-297"></span><span class="annot"><a href="GHC.Core.TyCo.FVs.html#tyCoVarsOfCos"><span class="hs-identifier hs-type">tyCoVarsOfCos</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="hs-special">[</span><span class="annot"><a href="GHC.Core.TyCo.Rep.html#Coercion"><span class="hs-identifier hs-type">Coercion</span></a></span><span class="hs-special">]</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Types.Var.Set.html#TyCoVarSet"><span class="hs-identifier hs-type">TyCoVarSet</span></a></span><span>
</span><span id="line-298"></span><span id="tyCoVarsOfCos"><span class="annot"><span class="annottext">tyCoVarsOfCos :: [Coercion] -&gt; VarSet
</span><a href="GHC.Core.TyCo.FVs.html#tyCoVarsOfCos"><span class="hs-identifier hs-var hs-var">tyCoVarsOfCos</span></a></span></span><span> </span><span id="local-6989586621680848121"><span class="annot"><span class="annottext">[Coercion]
</span><a href="#local-6989586621680848121"><span class="hs-identifier hs-var">cos</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Endo VarSet -&gt; VarSet
</span><a href="GHC.Core.TyCo.FVs.html#runTyCoVars"><span class="hs-identifier hs-var">runTyCoVars</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">[Coercion] -&gt; Endo VarSet
</span><a href="GHC.Core.TyCo.FVs.html#deep_cos"><span class="hs-identifier hs-var">deep_cos</span></a></span><span> </span><span class="annot"><span class="annottext">[Coercion]
</span><a href="#local-6989586621680848121"><span class="hs-identifier hs-var">cos</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-299"></span><span>
</span><span id="line-300"></span><span class="annot"><a href="GHC.Core.TyCo.FVs.html#deep_ty"><span class="hs-identifier hs-type">deep_ty</span></a></span><span>  </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Core.TyCo.Rep.html#Type"><span class="hs-identifier hs-type">Type</span></a></span><span>       </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="../../base/src/Data.Semigroup.Internal.html#Endo"><span class="hs-identifier hs-type">Endo</span></a></span><span> </span><span class="annot"><a href="GHC.Types.Var.Set.html#TyCoVarSet"><span class="hs-identifier hs-type">TyCoVarSet</span></a></span><span>
</span><span id="line-301"></span><span class="annot"><a href="GHC.Core.TyCo.FVs.html#deep_tys"><span class="hs-identifier hs-type">deep_tys</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="hs-special">[</span><span class="annot"><a href="GHC.Core.TyCo.Rep.html#Type"><span class="hs-identifier hs-type">Type</span></a></span><span class="hs-special">]</span><span>     </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="../../base/src/Data.Semigroup.Internal.html#Endo"><span class="hs-identifier hs-type">Endo</span></a></span><span> </span><span class="annot"><a href="GHC.Types.Var.Set.html#TyCoVarSet"><span class="hs-identifier hs-type">TyCoVarSet</span></a></span><span>
</span><span id="line-302"></span><span class="annot"><a href="GHC.Core.TyCo.FVs.html#deep_co"><span class="hs-identifier hs-type">deep_co</span></a></span><span>  </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Core.TyCo.Rep.html#Coercion"><span class="hs-identifier hs-type">Coercion</span></a></span><span>   </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="../../base/src/Data.Semigroup.Internal.html#Endo"><span class="hs-identifier hs-type">Endo</span></a></span><span> </span><span class="annot"><a href="GHC.Types.Var.Set.html#TyCoVarSet"><span class="hs-identifier hs-type">TyCoVarSet</span></a></span><span>
</span><span id="line-303"></span><span class="annot"><a href="GHC.Core.TyCo.FVs.html#deep_cos"><span class="hs-identifier hs-type">deep_cos</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="hs-special">[</span><span class="annot"><a href="GHC.Core.TyCo.Rep.html#Coercion"><span class="hs-identifier hs-type">Coercion</span></a></span><span class="hs-special">]</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="../../base/src/Data.Semigroup.Internal.html#Endo"><span class="hs-identifier hs-type">Endo</span></a></span><span> </span><span class="annot"><a href="GHC.Types.Var.Set.html#TyCoVarSet"><span class="hs-identifier hs-type">TyCoVarSet</span></a></span><span>
</span><span id="line-304"></span><span class="hs-special">(</span><span id="deep_ty"><span class="annot"><span class="annottext">Type -&gt; Endo VarSet
</span><a href="GHC.Core.TyCo.FVs.html#deep_ty"><span class="hs-identifier hs-var">deep_ty</span></a></span></span><span class="hs-special">,</span><span> </span><span id="deep_tys"><span class="annot"><span class="annottext">[Type] -&gt; Endo VarSet
</span><a href="GHC.Core.TyCo.FVs.html#deep_tys"><span class="hs-identifier hs-var">deep_tys</span></a></span></span><span class="hs-special">,</span><span> </span><span id="deep_co"><span class="annot"><span class="annottext">Coercion -&gt; Endo VarSet
</span><a href="GHC.Core.TyCo.FVs.html#deep_co"><span class="hs-identifier hs-var">deep_co</span></a></span></span><span class="hs-special">,</span><span> </span><span id="deep_cos"><span class="annot"><span class="annottext">[Coercion] -&gt; Endo VarSet
</span><a href="GHC.Core.TyCo.FVs.html#deep_cos"><span class="hs-identifier hs-var">deep_cos</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">TyCoFolder VarSet (Endo VarSet)
-&gt; VarSet
-&gt; (Type -&gt; Endo VarSet, [Type] -&gt; Endo VarSet,
    Coercion -&gt; Endo VarSet, [Coercion] -&gt; Endo VarSet)
forall a env.
Monoid a =&gt;
TyCoFolder env a
-&gt; env -&gt; (Type -&gt; a, [Type] -&gt; a, Coercion -&gt; a, [Coercion] -&gt; a)
</span><a href="GHC.Core.TyCo.Rep.html#foldTyCo"><span class="hs-identifier hs-var">foldTyCo</span></a></span><span> </span><span class="annot"><span class="annottext">TyCoFolder VarSet (Endo VarSet)
</span><a href="GHC.Core.TyCo.FVs.html#deepTcvFolder"><span class="hs-identifier hs-var">deepTcvFolder</span></a></span><span> </span><span class="annot"><span class="annottext">VarSet
</span><a href="GHC.Types.Var.Set.html#emptyVarSet"><span class="hs-identifier hs-var">emptyVarSet</span></a></span><span>
</span><span id="line-305"></span><span>
</span><span id="line-306"></span><span class="annot"><a href="GHC.Core.TyCo.FVs.html#deepTcvFolder"><span class="hs-identifier hs-type">deepTcvFolder</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Core.TyCo.Rep.html#TyCoFolder"><span class="hs-identifier hs-type">TyCoFolder</span></a></span><span> </span><span class="annot"><a href="GHC.Types.Var.Set.html#TyCoVarSet"><span class="hs-identifier hs-type">TyCoVarSet</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="../../base/src/Data.Semigroup.Internal.html#Endo"><span class="hs-identifier hs-type">Endo</span></a></span><span> </span><span class="annot"><a href="GHC.Types.Var.Set.html#TyCoVarSet"><span class="hs-identifier hs-type">TyCoVarSet</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-307"></span><span id="deepTcvFolder"><span class="annot"><span class="annottext">deepTcvFolder :: TyCoFolder VarSet (Endo VarSet)
</span><a href="GHC.Core.TyCo.FVs.html#deepTcvFolder"><span class="hs-identifier hs-var hs-var">deepTcvFolder</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">TyCoFolder :: forall env a.
(Type -&gt; Maybe Type)
-&gt; (env -&gt; TyCoVar -&gt; a)
-&gt; (env -&gt; TyCoVar -&gt; a)
-&gt; (env -&gt; CoercionHole -&gt; a)
-&gt; (env -&gt; TyCoVar -&gt; ArgFlag -&gt; env)
-&gt; TyCoFolder env a
</span><a href="GHC.Core.TyCo.Rep.html#TyCoFolder"><span class="hs-identifier hs-type">TyCoFolder</span></a></span><span> </span><span class="hs-special">{</span><span> </span><span class="annot"><span class="annottext">tcf_view :: Type -&gt; Maybe Type
</span><a href="GHC.Core.TyCo.Rep.html#tcf_view"><span class="hs-identifier hs-var">tcf_view</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Type -&gt; Maybe Type
</span><a href="GHC.Core.TyCo.FVs.html#noView"><span class="hs-identifier hs-var">noView</span></a></span><span>
</span><span id="line-308"></span><span>                           </span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">tcf_tyvar :: VarSet -&gt; TyCoVar -&gt; Endo VarSet
</span><a href="GHC.Core.TyCo.Rep.html#tcf_tyvar"><span class="hs-identifier hs-var">tcf_tyvar</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">VarSet -&gt; TyCoVar -&gt; Endo VarSet
</span><a href="#local-6989586621680848114"><span class="hs-identifier hs-var">do_tcv</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">tcf_covar :: VarSet -&gt; TyCoVar -&gt; Endo VarSet
</span><a href="GHC.Core.TyCo.Rep.html#tcf_covar"><span class="hs-identifier hs-var">tcf_covar</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">VarSet -&gt; TyCoVar -&gt; Endo VarSet
</span><a href="#local-6989586621680848114"><span class="hs-identifier hs-var">do_tcv</span></a></span><span>
</span><span id="line-309"></span><span>                           </span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">tcf_hole :: VarSet -&gt; CoercionHole -&gt; Endo VarSet
</span><a href="GHC.Core.TyCo.Rep.html#tcf_hole"><span class="hs-identifier hs-var">tcf_hole</span></a></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">VarSet -&gt; CoercionHole -&gt; Endo VarSet
</span><a href="#local-6989586621680848111"><span class="hs-identifier hs-var">do_hole</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">tcf_tycobinder :: VarSet -&gt; TyCoVar -&gt; ArgFlag -&gt; VarSet
</span><a href="GHC.Core.TyCo.Rep.html#tcf_tycobinder"><span class="hs-identifier hs-var">tcf_tycobinder</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">VarSet -&gt; TyCoVar -&gt; ArgFlag -&gt; VarSet
forall {p}. VarSet -&gt; TyCoVar -&gt; p -&gt; VarSet
</span><a href="#local-6989586621680848109"><span class="hs-identifier hs-var">do_bndr</span></a></span><span> </span><span class="hs-special">}</span><span>
</span><span id="line-310"></span><span>  </span><span class="hs-keyword">where</span><span>
</span><span id="line-311"></span><span>    </span><span id="local-6989586621680848114"><span class="annot"><span class="annottext">do_tcv :: VarSet -&gt; TyCoVar -&gt; Endo VarSet
</span><a href="#local-6989586621680848114"><span class="hs-identifier hs-var hs-var">do_tcv</span></a></span></span><span> </span><span id="local-6989586621680848108"><span class="annot"><span class="annottext">VarSet
</span><a href="#local-6989586621680848108"><span class="hs-identifier hs-var">is</span></a></span></span><span> </span><span id="local-6989586621680848107"><span class="annot"><span class="annottext">TyCoVar
</span><a href="#local-6989586621680848107"><span class="hs-identifier hs-var">v</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">(VarSet -&gt; VarSet) -&gt; Endo VarSet
forall a. (a -&gt; a) -&gt; Endo a
</span><a href="../../base/src/Data.Semigroup.Internal.html#Endo"><span class="hs-identifier hs-var">Endo</span></a></span><span> </span><span class="annot"><span class="annottext">VarSet -&gt; VarSet
</span><a href="#local-6989586621680848105"><span class="hs-identifier hs-var">do_it</span></a></span><span>
</span><span id="line-312"></span><span>      </span><span class="hs-keyword">where</span><span>
</span><span id="line-313"></span><span>        </span><span id="local-6989586621680848105"><span class="annot"><span class="annottext">do_it :: VarSet -&gt; VarSet
</span><a href="#local-6989586621680848105"><span class="hs-identifier hs-var hs-var">do_it</span></a></span></span><span> </span><span id="local-6989586621680848104"><span class="annot"><span class="annottext">VarSet
</span><a href="#local-6989586621680848104"><span class="hs-identifier hs-var">acc</span></a></span></span><span> </span><span class="hs-glyph">|</span><span> </span><span class="annot"><span class="annottext">TyCoVar
</span><a href="#local-6989586621680848107"><span class="hs-identifier hs-var">v</span></a></span><span> </span><span class="annot"><span class="annottext">TyCoVar -&gt; VarSet -&gt; Bool
</span><a href="GHC.Types.Var.Set.html#elemVarSet"><span class="hs-operator hs-var">`elemVarSet`</span></a></span><span> </span><span class="annot"><span class="annottext">VarSet
</span><a href="#local-6989586621680848108"><span class="hs-identifier hs-var">is</span></a></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">VarSet
</span><a href="#local-6989586621680848104"><span class="hs-identifier hs-var">acc</span></a></span><span>
</span><span id="line-314"></span><span>                  </span><span class="hs-glyph">|</span><span> </span><span class="annot"><span class="annottext">TyCoVar
</span><a href="#local-6989586621680848107"><span class="hs-identifier hs-var">v</span></a></span><span> </span><span class="annot"><span class="annottext">TyCoVar -&gt; VarSet -&gt; Bool
</span><a href="GHC.Types.Var.Set.html#elemVarSet"><span class="hs-operator hs-var">`elemVarSet`</span></a></span><span> </span><span class="annot"><span class="annottext">VarSet
</span><a href="#local-6989586621680848104"><span class="hs-identifier hs-var">acc</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">VarSet
</span><a href="#local-6989586621680848104"><span class="hs-identifier hs-var">acc</span></a></span><span>
</span><span id="line-315"></span><span>                  </span><span class="hs-glyph">|</span><span> </span><span class="annot"><span class="annottext">Bool
</span><a href="../../base/src/GHC.Base.html#otherwise"><span class="hs-identifier hs-var">otherwise</span></a></span><span>          </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Endo VarSet -&gt; VarSet -&gt; VarSet
forall a. Endo a -&gt; a -&gt; a
</span><a href="../../base/src/Data.Semigroup.Internal.html#appEndo"><span class="hs-identifier hs-var hs-var">appEndo</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Type -&gt; Endo VarSet
</span><a href="GHC.Core.TyCo.FVs.html#deep_ty"><span class="hs-identifier hs-var">deep_ty</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">TyCoVar -&gt; Type
</span><a href="GHC.Types.Var.html#varType"><span class="hs-identifier hs-var hs-var">varType</span></a></span><span> </span><span class="annot"><span class="annottext">TyCoVar
</span><a href="#local-6989586621680848107"><span class="hs-identifier hs-var">v</span></a></span><span class="hs-special">)</span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">(VarSet -&gt; VarSet) -&gt; VarSet -&gt; VarSet
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span>
</span><span id="line-316"></span><span>                                         </span><span class="annot"><span class="annottext">VarSet
</span><a href="#local-6989586621680848104"><span class="hs-identifier hs-var">acc</span></a></span><span> </span><span class="annot"><span class="annottext">VarSet -&gt; TyCoVar -&gt; VarSet
</span><a href="GHC.Types.Var.Set.html#extendVarSet"><span class="hs-operator hs-var">`extendVarSet`</span></a></span><span> </span><span class="annot"><span class="annottext">TyCoVar
</span><a href="#local-6989586621680848107"><span class="hs-identifier hs-var">v</span></a></span><span>
</span><span id="line-317"></span><span>
</span><span id="line-318"></span><span>    </span><span id="local-6989586621680848109"><span class="annot"><span class="annottext">do_bndr :: VarSet -&gt; TyCoVar -&gt; p -&gt; VarSet
</span><a href="#local-6989586621680848109"><span class="hs-identifier hs-var hs-var">do_bndr</span></a></span></span><span> </span><span id="local-6989586621680848100"><span class="annot"><span class="annottext">VarSet
</span><a href="#local-6989586621680848100"><span class="hs-identifier hs-var">is</span></a></span></span><span> </span><span id="local-6989586621680848099"><span class="annot"><span class="annottext">TyCoVar
</span><a href="#local-6989586621680848099"><span class="hs-identifier hs-var">tcv</span></a></span></span><span> </span><span class="annot"><span class="annottext">p
</span><span class="hs-identifier">_</span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">VarSet -&gt; TyCoVar -&gt; VarSet
</span><a href="GHC.Types.Var.Set.html#extendVarSet"><span class="hs-identifier hs-var">extendVarSet</span></a></span><span> </span><span class="annot"><span class="annottext">VarSet
</span><a href="#local-6989586621680848100"><span class="hs-identifier hs-var">is</span></a></span><span> </span><span class="annot"><span class="annottext">TyCoVar
</span><a href="#local-6989586621680848099"><span class="hs-identifier hs-var">tcv</span></a></span><span>
</span><span id="line-319"></span><span>    </span><span id="local-6989586621680848111"><span class="annot"><span class="annottext">do_hole :: VarSet -&gt; CoercionHole -&gt; Endo VarSet
</span><a href="#local-6989586621680848111"><span class="hs-identifier hs-var hs-var">do_hole</span></a></span></span><span> </span><span id="local-6989586621680848098"><span class="annot"><span class="annottext">VarSet
</span><a href="#local-6989586621680848098"><span class="hs-identifier hs-var">is</span></a></span></span><span> </span><span id="local-6989586621680848097"><span class="annot"><span class="annottext">CoercionHole
</span><a href="#local-6989586621680848097"><span class="hs-identifier hs-var">hole</span></a></span></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">VarSet -&gt; TyCoVar -&gt; Endo VarSet
</span><a href="#local-6989586621680848114"><span class="hs-identifier hs-var">do_tcv</span></a></span><span> </span><span class="annot"><span class="annottext">VarSet
</span><a href="#local-6989586621680848098"><span class="hs-identifier hs-var">is</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">CoercionHole -&gt; TyCoVar
</span><a href="GHC.Core.TyCo.Rep.html#coHoleCoVar"><span class="hs-identifier hs-var">coHoleCoVar</span></a></span><span> </span><span class="annot"><span class="annottext">CoercionHole
</span><a href="#local-6989586621680848097"><span class="hs-identifier hs-var">hole</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-320"></span><span>                       </span><span class="hs-comment">-- See Note [CoercionHoles and coercion free variables]</span><span>
</span><span id="line-321"></span><span>                       </span><span class="hs-comment">-- in GHC.Core.TyCo.Rep</span><span>
</span><span id="line-322"></span><span>
</span><span id="line-323"></span><span class="hs-comment">{- *********************************************************************
*                                                                      *
          Shallow free variables
          See Note [Shallow and deep free variables]
*                                                                      *
********************************************************************* -}</span><span>
</span><span id="line-329"></span><span>
</span><span id="line-330"></span><span>
</span><span id="line-331"></span><span class="annot"><a href="GHC.Core.TyCo.FVs.html#shallowTyCoVarsOfType"><span class="hs-identifier hs-type">shallowTyCoVarsOfType</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Core.TyCo.Rep.html#Type"><span class="hs-identifier hs-type">Type</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Types.Var.Set.html#TyCoVarSet"><span class="hs-identifier hs-type">TyCoVarSet</span></a></span><span>
</span><span id="line-332"></span><span class="hs-comment">-- See Note [Free variables of types]</span><span>
</span><span id="line-333"></span><span id="shallowTyCoVarsOfType"><span class="annot"><span class="annottext">shallowTyCoVarsOfType :: Type -&gt; VarSet
</span><a href="GHC.Core.TyCo.FVs.html#shallowTyCoVarsOfType"><span class="hs-identifier hs-var hs-var">shallowTyCoVarsOfType</span></a></span></span><span> </span><span id="local-6989586621680848095"><span class="annot"><span class="annottext">Type
</span><a href="#local-6989586621680848095"><span class="hs-identifier hs-var">ty</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Endo VarSet -&gt; VarSet
</span><a href="GHC.Core.TyCo.FVs.html#runTyCoVars"><span class="hs-identifier hs-var">runTyCoVars</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Type -&gt; Endo VarSet
</span><a href="GHC.Core.TyCo.FVs.html#shallow_ty"><span class="hs-identifier hs-var">shallow_ty</span></a></span><span> </span><span class="annot"><span class="annottext">Type
</span><a href="#local-6989586621680848095"><span class="hs-identifier hs-var">ty</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-334"></span><span>
</span><span id="line-335"></span><span class="annot"><a href="GHC.Core.TyCo.FVs.html#shallowTyCoVarsOfTypes"><span class="hs-identifier hs-type">shallowTyCoVarsOfTypes</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="hs-special">[</span><span class="annot"><a href="GHC.Core.TyCo.Rep.html#Type"><span class="hs-identifier hs-type">Type</span></a></span><span class="hs-special">]</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Types.Var.Set.html#TyCoVarSet"><span class="hs-identifier hs-type">TyCoVarSet</span></a></span><span>
</span><span id="line-336"></span><span id="shallowTyCoVarsOfTypes"><span class="annot"><span class="annottext">shallowTyCoVarsOfTypes :: [Type] -&gt; VarSet
</span><a href="GHC.Core.TyCo.FVs.html#shallowTyCoVarsOfTypes"><span class="hs-identifier hs-var hs-var">shallowTyCoVarsOfTypes</span></a></span></span><span> </span><span id="local-6989586621680848093"><span class="annot"><span class="annottext">[Type]
</span><a href="#local-6989586621680848093"><span class="hs-identifier hs-var">tys</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Endo VarSet -&gt; VarSet
</span><a href="GHC.Core.TyCo.FVs.html#runTyCoVars"><span class="hs-identifier hs-var">runTyCoVars</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">[Type] -&gt; Endo VarSet
</span><a href="GHC.Core.TyCo.FVs.html#shallow_tys"><span class="hs-identifier hs-var">shallow_tys</span></a></span><span> </span><span class="annot"><span class="annottext">[Type]
</span><a href="#local-6989586621680848093"><span class="hs-identifier hs-var">tys</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-337"></span><span>
</span><span id="line-338"></span><span class="annot"><a href="GHC.Core.TyCo.FVs.html#shallowTyCoVarsOfCo"><span class="hs-identifier hs-type">shallowTyCoVarsOfCo</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Core.TyCo.Rep.html#Coercion"><span class="hs-identifier hs-type">Coercion</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Types.Var.Set.html#TyCoVarSet"><span class="hs-identifier hs-type">TyCoVarSet</span></a></span><span>
</span><span id="line-339"></span><span id="shallowTyCoVarsOfCo"><span class="annot"><span class="annottext">shallowTyCoVarsOfCo :: Coercion -&gt; VarSet
</span><a href="GHC.Core.TyCo.FVs.html#shallowTyCoVarsOfCo"><span class="hs-identifier hs-var hs-var">shallowTyCoVarsOfCo</span></a></span></span><span> </span><span id="local-6989586621680848091"><span class="annot"><span class="annottext">Coercion
</span><a href="#local-6989586621680848091"><span class="hs-identifier hs-var">co</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Endo VarSet -&gt; VarSet
</span><a href="GHC.Core.TyCo.FVs.html#runTyCoVars"><span class="hs-identifier hs-var">runTyCoVars</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Coercion -&gt; Endo VarSet
</span><a href="GHC.Core.TyCo.FVs.html#shallow_co"><span class="hs-identifier hs-var">shallow_co</span></a></span><span> </span><span class="annot"><span class="annottext">Coercion
</span><a href="#local-6989586621680848091"><span class="hs-identifier hs-var">co</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-340"></span><span>
</span><span id="line-341"></span><span class="annot"><a href="GHC.Core.TyCo.FVs.html#shallowTyCoVarsOfCos"><span class="hs-identifier hs-type">shallowTyCoVarsOfCos</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="hs-special">[</span><span class="annot"><a href="GHC.Core.TyCo.Rep.html#Coercion"><span class="hs-identifier hs-type">Coercion</span></a></span><span class="hs-special">]</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Types.Var.Set.html#TyCoVarSet"><span class="hs-identifier hs-type">TyCoVarSet</span></a></span><span>
</span><span id="line-342"></span><span id="shallowTyCoVarsOfCos"><span class="annot"><span class="annottext">shallowTyCoVarsOfCos :: [Coercion] -&gt; VarSet
</span><a href="GHC.Core.TyCo.FVs.html#shallowTyCoVarsOfCos"><span class="hs-identifier hs-var hs-var">shallowTyCoVarsOfCos</span></a></span></span><span> </span><span id="local-6989586621680848089"><span class="annot"><span class="annottext">[Coercion]
</span><a href="#local-6989586621680848089"><span class="hs-identifier hs-var">cos</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Endo VarSet -&gt; VarSet
</span><a href="GHC.Core.TyCo.FVs.html#runTyCoVars"><span class="hs-identifier hs-var">runTyCoVars</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">[Coercion] -&gt; Endo VarSet
</span><a href="GHC.Core.TyCo.FVs.html#shallow_cos"><span class="hs-identifier hs-var">shallow_cos</span></a></span><span> </span><span class="annot"><span class="annottext">[Coercion]
</span><a href="#local-6989586621680848089"><span class="hs-identifier hs-var">cos</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-343"></span><span>
</span><span id="line-344"></span><span class="hs-comment">-- | Returns free variables of types, including kind variables as</span><span>
</span><span id="line-345"></span><span class="hs-comment">-- a non-deterministic set. For type synonyms it does /not/ expand the</span><span>
</span><span id="line-346"></span><span class="hs-comment">-- synonym.</span><span>
</span><span id="line-347"></span><span class="annot"><a href="GHC.Core.TyCo.FVs.html#shallowTyCoVarsOfTyVarEnv"><span class="hs-identifier hs-type">shallowTyCoVarsOfTyVarEnv</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Types.Var.Env.html#TyVarEnv"><span class="hs-identifier hs-type">TyVarEnv</span></a></span><span> </span><span class="annot"><a href="GHC.Core.TyCo.Rep.html#Type"><span class="hs-identifier hs-type">Type</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Types.Var.Set.html#TyCoVarSet"><span class="hs-identifier hs-type">TyCoVarSet</span></a></span><span>
</span><span id="line-348"></span><span class="hs-comment">-- See Note [Free variables of types]</span><span>
</span><span id="line-349"></span><span id="shallowTyCoVarsOfTyVarEnv"><span class="annot"><span class="annottext">shallowTyCoVarsOfTyVarEnv :: TyVarEnv Type -&gt; VarSet
</span><a href="GHC.Core.TyCo.FVs.html#shallowTyCoVarsOfTyVarEnv"><span class="hs-identifier hs-var hs-var">shallowTyCoVarsOfTyVarEnv</span></a></span></span><span> </span><span id="local-6989586621680848087"><span class="annot"><span class="annottext">TyVarEnv Type
</span><a href="#local-6989586621680848087"><span class="hs-identifier hs-var">tys</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">[Type] -&gt; VarSet
</span><a href="GHC.Core.TyCo.FVs.html#shallowTyCoVarsOfTypes"><span class="hs-identifier hs-var">shallowTyCoVarsOfTypes</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">TyVarEnv Type -&gt; [Type]
forall key elt. UniqFM key elt -&gt; [elt]
</span><a href="GHC.Types.Unique.FM.html#nonDetEltsUFM"><span class="hs-identifier hs-var">nonDetEltsUFM</span></a></span><span> </span><span class="annot"><span class="annottext">TyVarEnv Type
</span><a href="#local-6989586621680848087"><span class="hs-identifier hs-var">tys</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-350"></span><span>  </span><span class="hs-comment">-- It's OK to use nonDetEltsUFM here because we immediately</span><span>
</span><span id="line-351"></span><span>  </span><span class="hs-comment">-- forget the ordering by returning a set</span><span>
</span><span id="line-352"></span><span>
</span><span id="line-353"></span><span class="annot"><a href="GHC.Core.TyCo.FVs.html#shallowTyCoVarsOfCoVarEnv"><span class="hs-identifier hs-type">shallowTyCoVarsOfCoVarEnv</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Types.Var.Env.html#CoVarEnv"><span class="hs-identifier hs-type">CoVarEnv</span></a></span><span> </span><span class="annot"><a href="GHC.Core.TyCo.Rep.html#Coercion"><span class="hs-identifier hs-type">Coercion</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Types.Var.Set.html#TyCoVarSet"><span class="hs-identifier hs-type">TyCoVarSet</span></a></span><span>
</span><span id="line-354"></span><span id="shallowTyCoVarsOfCoVarEnv"><span class="annot"><span class="annottext">shallowTyCoVarsOfCoVarEnv :: CoVarEnv Coercion -&gt; VarSet
</span><a href="GHC.Core.TyCo.FVs.html#shallowTyCoVarsOfCoVarEnv"><span class="hs-identifier hs-var hs-var">shallowTyCoVarsOfCoVarEnv</span></a></span></span><span> </span><span id="local-6989586621680848085"><span class="annot"><span class="annottext">CoVarEnv Coercion
</span><a href="#local-6989586621680848085"><span class="hs-identifier hs-var">cos</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">[Coercion] -&gt; VarSet
</span><a href="GHC.Core.TyCo.FVs.html#shallowTyCoVarsOfCos"><span class="hs-identifier hs-var">shallowTyCoVarsOfCos</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">CoVarEnv Coercion -&gt; [Coercion]
forall key elt. UniqFM key elt -&gt; [elt]
</span><a href="GHC.Types.Unique.FM.html#nonDetEltsUFM"><span class="hs-identifier hs-var">nonDetEltsUFM</span></a></span><span> </span><span class="annot"><span class="annottext">CoVarEnv Coercion
</span><a href="#local-6989586621680848085"><span class="hs-identifier hs-var">cos</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-355"></span><span>  </span><span class="hs-comment">-- It's OK to use nonDetEltsUFM here because we immediately</span><span>
</span><span id="line-356"></span><span>  </span><span class="hs-comment">-- forget the ordering by returning a set</span><span>
</span><span id="line-357"></span><span>
</span><span id="line-358"></span><span class="annot"><a href="GHC.Core.TyCo.FVs.html#shallow_ty"><span class="hs-identifier hs-type">shallow_ty</span></a></span><span>  </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Core.TyCo.Rep.html#Type"><span class="hs-identifier hs-type">Type</span></a></span><span>       </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="../../base/src/Data.Semigroup.Internal.html#Endo"><span class="hs-identifier hs-type">Endo</span></a></span><span> </span><span class="annot"><a href="GHC.Types.Var.Set.html#TyCoVarSet"><span class="hs-identifier hs-type">TyCoVarSet</span></a></span><span>
</span><span id="line-359"></span><span class="annot"><a href="GHC.Core.TyCo.FVs.html#shallow_tys"><span class="hs-identifier hs-type">shallow_tys</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="hs-special">[</span><span class="annot"><a href="GHC.Core.TyCo.Rep.html#Type"><span class="hs-identifier hs-type">Type</span></a></span><span class="hs-special">]</span><span>     </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="../../base/src/Data.Semigroup.Internal.html#Endo"><span class="hs-identifier hs-type">Endo</span></a></span><span> </span><span class="annot"><a href="GHC.Types.Var.Set.html#TyCoVarSet"><span class="hs-identifier hs-type">TyCoVarSet</span></a></span><span>
</span><span id="line-360"></span><span class="annot"><a href="GHC.Core.TyCo.FVs.html#shallow_co"><span class="hs-identifier hs-type">shallow_co</span></a></span><span>  </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Core.TyCo.Rep.html#Coercion"><span class="hs-identifier hs-type">Coercion</span></a></span><span>   </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="../../base/src/Data.Semigroup.Internal.html#Endo"><span class="hs-identifier hs-type">Endo</span></a></span><span> </span><span class="annot"><a href="GHC.Types.Var.Set.html#TyCoVarSet"><span class="hs-identifier hs-type">TyCoVarSet</span></a></span><span>
</span><span id="line-361"></span><span class="annot"><a href="GHC.Core.TyCo.FVs.html#shallow_cos"><span class="hs-identifier hs-type">shallow_cos</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="hs-special">[</span><span class="annot"><a href="GHC.Core.TyCo.Rep.html#Coercion"><span class="hs-identifier hs-type">Coercion</span></a></span><span class="hs-special">]</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="../../base/src/Data.Semigroup.Internal.html#Endo"><span class="hs-identifier hs-type">Endo</span></a></span><span> </span><span class="annot"><a href="GHC.Types.Var.Set.html#TyCoVarSet"><span class="hs-identifier hs-type">TyCoVarSet</span></a></span><span>
</span><span id="line-362"></span><span class="hs-special">(</span><span id="shallow_ty"><span class="annot"><span class="annottext">Type -&gt; Endo VarSet
</span><a href="GHC.Core.TyCo.FVs.html#shallow_ty"><span class="hs-identifier hs-var">shallow_ty</span></a></span></span><span class="hs-special">,</span><span> </span><span id="shallow_tys"><span class="annot"><span class="annottext">[Type] -&gt; Endo VarSet
</span><a href="GHC.Core.TyCo.FVs.html#shallow_tys"><span class="hs-identifier hs-var">shallow_tys</span></a></span></span><span class="hs-special">,</span><span> </span><span id="shallow_co"><span class="annot"><span class="annottext">Coercion -&gt; Endo VarSet
</span><a href="GHC.Core.TyCo.FVs.html#shallow_co"><span class="hs-identifier hs-var">shallow_co</span></a></span></span><span class="hs-special">,</span><span> </span><span id="shallow_cos"><span class="annot"><span class="annottext">[Coercion] -&gt; Endo VarSet
</span><a href="GHC.Core.TyCo.FVs.html#shallow_cos"><span class="hs-identifier hs-var">shallow_cos</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">TyCoFolder VarSet (Endo VarSet)
-&gt; VarSet
-&gt; (Type -&gt; Endo VarSet, [Type] -&gt; Endo VarSet,
    Coercion -&gt; Endo VarSet, [Coercion] -&gt; Endo VarSet)
forall a env.
Monoid a =&gt;
TyCoFolder env a
-&gt; env -&gt; (Type -&gt; a, [Type] -&gt; a, Coercion -&gt; a, [Coercion] -&gt; a)
</span><a href="GHC.Core.TyCo.Rep.html#foldTyCo"><span class="hs-identifier hs-var">foldTyCo</span></a></span><span> </span><span class="annot"><span class="annottext">TyCoFolder VarSet (Endo VarSet)
</span><a href="GHC.Core.TyCo.FVs.html#shallowTcvFolder"><span class="hs-identifier hs-var">shallowTcvFolder</span></a></span><span> </span><span class="annot"><span class="annottext">VarSet
</span><a href="GHC.Types.Var.Set.html#emptyVarSet"><span class="hs-identifier hs-var">emptyVarSet</span></a></span><span>
</span><span id="line-363"></span><span>
</span><span id="line-364"></span><span class="annot"><a href="GHC.Core.TyCo.FVs.html#shallowTcvFolder"><span class="hs-identifier hs-type">shallowTcvFolder</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Core.TyCo.Rep.html#TyCoFolder"><span class="hs-identifier hs-type">TyCoFolder</span></a></span><span> </span><span class="annot"><a href="GHC.Types.Var.Set.html#TyCoVarSet"><span class="hs-identifier hs-type">TyCoVarSet</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="../../base/src/Data.Semigroup.Internal.html#Endo"><span class="hs-identifier hs-type">Endo</span></a></span><span> </span><span class="annot"><a href="GHC.Types.Var.Set.html#TyCoVarSet"><span class="hs-identifier hs-type">TyCoVarSet</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-365"></span><span id="shallowTcvFolder"><span class="annot"><span class="annottext">shallowTcvFolder :: TyCoFolder VarSet (Endo VarSet)
</span><a href="GHC.Core.TyCo.FVs.html#shallowTcvFolder"><span class="hs-identifier hs-var hs-var">shallowTcvFolder</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">TyCoFolder :: forall env a.
(Type -&gt; Maybe Type)
-&gt; (env -&gt; TyCoVar -&gt; a)
-&gt; (env -&gt; TyCoVar -&gt; a)
-&gt; (env -&gt; CoercionHole -&gt; a)
-&gt; (env -&gt; TyCoVar -&gt; ArgFlag -&gt; env)
-&gt; TyCoFolder env a
</span><a href="GHC.Core.TyCo.Rep.html#TyCoFolder"><span class="hs-identifier hs-type">TyCoFolder</span></a></span><span> </span><span class="hs-special">{</span><span> </span><span class="annot"><span class="annottext">tcf_view :: Type -&gt; Maybe Type
</span><a href="GHC.Core.TyCo.Rep.html#tcf_view"><span class="hs-identifier hs-var">tcf_view</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Type -&gt; Maybe Type
</span><a href="GHC.Core.TyCo.FVs.html#noView"><span class="hs-identifier hs-var">noView</span></a></span><span>
</span><span id="line-366"></span><span>                              </span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">tcf_tyvar :: VarSet -&gt; TyCoVar -&gt; Endo VarSet
</span><a href="GHC.Core.TyCo.Rep.html#tcf_tyvar"><span class="hs-identifier hs-var">tcf_tyvar</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">VarSet -&gt; TyCoVar -&gt; Endo VarSet
</span><a href="#local-6989586621680848082"><span class="hs-identifier hs-var">do_tcv</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">tcf_covar :: VarSet -&gt; TyCoVar -&gt; Endo VarSet
</span><a href="GHC.Core.TyCo.Rep.html#tcf_covar"><span class="hs-identifier hs-var">tcf_covar</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">VarSet -&gt; TyCoVar -&gt; Endo VarSet
</span><a href="#local-6989586621680848082"><span class="hs-identifier hs-var">do_tcv</span></a></span><span>
</span><span id="line-367"></span><span>                              </span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">tcf_hole :: VarSet -&gt; CoercionHole -&gt; Endo VarSet
</span><a href="GHC.Core.TyCo.Rep.html#tcf_hole"><span class="hs-identifier hs-var">tcf_hole</span></a></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">VarSet -&gt; CoercionHole -&gt; Endo VarSet
forall {a} {p} {p}. Monoid a =&gt; p -&gt; p -&gt; a
</span><a href="#local-6989586621680848081"><span class="hs-identifier hs-var">do_hole</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">tcf_tycobinder :: VarSet -&gt; TyCoVar -&gt; ArgFlag -&gt; VarSet
</span><a href="GHC.Core.TyCo.Rep.html#tcf_tycobinder"><span class="hs-identifier hs-var">tcf_tycobinder</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">VarSet -&gt; TyCoVar -&gt; ArgFlag -&gt; VarSet
forall {p}. VarSet -&gt; TyCoVar -&gt; p -&gt; VarSet
</span><a href="#local-6989586621680848080"><span class="hs-identifier hs-var">do_bndr</span></a></span><span> </span><span class="hs-special">}</span><span>
</span><span id="line-368"></span><span>  </span><span class="hs-keyword">where</span><span>
</span><span id="line-369"></span><span>    </span><span id="local-6989586621680848082"><span class="annot"><span class="annottext">do_tcv :: VarSet -&gt; TyCoVar -&gt; Endo VarSet
</span><a href="#local-6989586621680848082"><span class="hs-identifier hs-var hs-var">do_tcv</span></a></span></span><span> </span><span id="local-6989586621680848079"><span class="annot"><span class="annottext">VarSet
</span><a href="#local-6989586621680848079"><span class="hs-identifier hs-var">is</span></a></span></span><span> </span><span id="local-6989586621680848078"><span class="annot"><span class="annottext">TyCoVar
</span><a href="#local-6989586621680848078"><span class="hs-identifier hs-var">v</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">(VarSet -&gt; VarSet) -&gt; Endo VarSet
forall a. (a -&gt; a) -&gt; Endo a
</span><a href="../../base/src/Data.Semigroup.Internal.html#Endo"><span class="hs-identifier hs-var">Endo</span></a></span><span> </span><span class="annot"><span class="annottext">VarSet -&gt; VarSet
</span><a href="#local-6989586621680848077"><span class="hs-identifier hs-var">do_it</span></a></span><span>
</span><span id="line-370"></span><span>      </span><span class="hs-keyword">where</span><span>
</span><span id="line-371"></span><span>        </span><span id="local-6989586621680848077"><span class="annot"><span class="annottext">do_it :: VarSet -&gt; VarSet
</span><a href="#local-6989586621680848077"><span class="hs-identifier hs-var hs-var">do_it</span></a></span></span><span> </span><span id="local-6989586621680848076"><span class="annot"><span class="annottext">VarSet
</span><a href="#local-6989586621680848076"><span class="hs-identifier hs-var">acc</span></a></span></span><span> </span><span class="hs-glyph">|</span><span> </span><span class="annot"><span class="annottext">TyCoVar
</span><a href="#local-6989586621680848078"><span class="hs-identifier hs-var">v</span></a></span><span> </span><span class="annot"><span class="annottext">TyCoVar -&gt; VarSet -&gt; Bool
</span><a href="GHC.Types.Var.Set.html#elemVarSet"><span class="hs-operator hs-var">`elemVarSet`</span></a></span><span> </span><span class="annot"><span class="annottext">VarSet
</span><a href="#local-6989586621680848079"><span class="hs-identifier hs-var">is</span></a></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">VarSet
</span><a href="#local-6989586621680848076"><span class="hs-identifier hs-var">acc</span></a></span><span>
</span><span id="line-372"></span><span>                  </span><span class="hs-glyph">|</span><span> </span><span class="annot"><span class="annottext">TyCoVar
</span><a href="#local-6989586621680848078"><span class="hs-identifier hs-var">v</span></a></span><span> </span><span class="annot"><span class="annottext">TyCoVar -&gt; VarSet -&gt; Bool
</span><a href="GHC.Types.Var.Set.html#elemVarSet"><span class="hs-operator hs-var">`elemVarSet`</span></a></span><span> </span><span class="annot"><span class="annottext">VarSet
</span><a href="#local-6989586621680848076"><span class="hs-identifier hs-var">acc</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">VarSet
</span><a href="#local-6989586621680848076"><span class="hs-identifier hs-var">acc</span></a></span><span>
</span><span id="line-373"></span><span>                  </span><span class="hs-glyph">|</span><span> </span><span class="annot"><span class="annottext">Bool
</span><a href="../../base/src/GHC.Base.html#otherwise"><span class="hs-identifier hs-var">otherwise</span></a></span><span>          </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">VarSet
</span><a href="#local-6989586621680848076"><span class="hs-identifier hs-var">acc</span></a></span><span> </span><span class="annot"><span class="annottext">VarSet -&gt; TyCoVar -&gt; VarSet
</span><a href="GHC.Types.Var.Set.html#extendVarSet"><span class="hs-operator hs-var">`extendVarSet`</span></a></span><span> </span><span class="annot"><span class="annottext">TyCoVar
</span><a href="#local-6989586621680848078"><span class="hs-identifier hs-var">v</span></a></span><span>
</span><span id="line-374"></span><span>
</span><span id="line-375"></span><span>    </span><span id="local-6989586621680848080"><span class="annot"><span class="annottext">do_bndr :: VarSet -&gt; TyCoVar -&gt; p -&gt; VarSet
</span><a href="#local-6989586621680848080"><span class="hs-identifier hs-var hs-var">do_bndr</span></a></span></span><span> </span><span id="local-6989586621680848075"><span class="annot"><span class="annottext">VarSet
</span><a href="#local-6989586621680848075"><span class="hs-identifier hs-var">is</span></a></span></span><span> </span><span id="local-6989586621680848074"><span class="annot"><span class="annottext">TyCoVar
</span><a href="#local-6989586621680848074"><span class="hs-identifier hs-var">tcv</span></a></span></span><span> </span><span class="annot"><span class="annottext">p
</span><span class="hs-identifier">_</span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">VarSet -&gt; TyCoVar -&gt; VarSet
</span><a href="GHC.Types.Var.Set.html#extendVarSet"><span class="hs-identifier hs-var">extendVarSet</span></a></span><span> </span><span class="annot"><span class="annottext">VarSet
</span><a href="#local-6989586621680848075"><span class="hs-identifier hs-var">is</span></a></span><span> </span><span class="annot"><span class="annottext">TyCoVar
</span><a href="#local-6989586621680848074"><span class="hs-identifier hs-var">tcv</span></a></span><span>
</span><span id="line-376"></span><span>    </span><span id="local-6989586621680848081"><span class="annot"><span class="annottext">do_hole :: p -&gt; p -&gt; a
</span><a href="#local-6989586621680848081"><span class="hs-identifier hs-var hs-var">do_hole</span></a></span></span><span> </span><span class="annot"><span class="annottext">p
</span><span class="hs-identifier">_</span></span><span> </span><span class="annot"><span class="annottext">p
</span><span class="hs-identifier">_</span></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">a
forall a. Monoid a =&gt; a
</span><a href="../../base/src/GHC.Base.html#mempty"><span class="hs-identifier hs-var">mempty</span></a></span><span>   </span><span class="hs-comment">-- Ignore coercion holes</span><span>
</span><span id="line-377"></span><span>
</span><span id="line-378"></span><span>
</span><span id="line-379"></span><span class="hs-comment">{- *********************************************************************
*                                                                      *
          Free coercion variables
*                                                                      *
********************************************************************* -}</span><span>
</span><span id="line-384"></span><span>
</span><span id="line-385"></span><span>
</span><span id="line-386"></span><span class="hs-comment">{- Note [Finding free coercion varibles]
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Here we are only interested in the free /coercion/ variables.
We can achieve this through a slightly differnet TyCo folder.

Notice that we look deeply, into kinds.

See #14880.
-}</span><span>
</span><span id="line-395"></span><span>
</span><span id="line-396"></span><span class="annot"><a href="GHC.Core.TyCo.FVs.html#coVarsOfType"><span class="hs-identifier hs-type">coVarsOfType</span></a></span><span>  </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Core.TyCo.Rep.html#Type"><span class="hs-identifier hs-type">Type</span></a></span><span>       </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Types.Var.Set.html#CoVarSet"><span class="hs-identifier hs-type">CoVarSet</span></a></span><span>
</span><span id="line-397"></span><span class="annot"><a href="GHC.Core.TyCo.FVs.html#coVarsOfTypes"><span class="hs-identifier hs-type">coVarsOfTypes</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="hs-special">[</span><span class="annot"><a href="GHC.Core.TyCo.Rep.html#Type"><span class="hs-identifier hs-type">Type</span></a></span><span class="hs-special">]</span><span>     </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Types.Var.Set.html#CoVarSet"><span class="hs-identifier hs-type">CoVarSet</span></a></span><span>
</span><span id="line-398"></span><span class="annot"><a href="GHC.Core.TyCo.FVs.html#coVarsOfCo"><span class="hs-identifier hs-type">coVarsOfCo</span></a></span><span>    </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Core.TyCo.Rep.html#Coercion"><span class="hs-identifier hs-type">Coercion</span></a></span><span>   </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Types.Var.Set.html#CoVarSet"><span class="hs-identifier hs-type">CoVarSet</span></a></span><span>
</span><span id="line-399"></span><span class="annot"><a href="GHC.Core.TyCo.FVs.html#coVarsOfCos"><span class="hs-identifier hs-type">coVarsOfCos</span></a></span><span>   </span><span class="hs-glyph">::</span><span> </span><span class="hs-special">[</span><span class="annot"><a href="GHC.Core.TyCo.Rep.html#Coercion"><span class="hs-identifier hs-type">Coercion</span></a></span><span class="hs-special">]</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Types.Var.Set.html#CoVarSet"><span class="hs-identifier hs-type">CoVarSet</span></a></span><span>
</span><span id="line-400"></span><span>
</span><span id="line-401"></span><span id="coVarsOfType"><span class="annot"><span class="annottext">coVarsOfType :: Type -&gt; VarSet
</span><a href="GHC.Core.TyCo.FVs.html#coVarsOfType"><span class="hs-identifier hs-var hs-var">coVarsOfType</span></a></span></span><span>  </span><span id="local-6989586621680848070"><span class="annot"><span class="annottext">Type
</span><a href="#local-6989586621680848070"><span class="hs-identifier hs-var">ty</span></a></span></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Endo VarSet -&gt; VarSet
</span><a href="GHC.Core.TyCo.FVs.html#runTyCoVars"><span class="hs-identifier hs-var">runTyCoVars</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Type -&gt; Endo VarSet
</span><a href="GHC.Core.TyCo.FVs.html#deep_cv_ty"><span class="hs-identifier hs-var">deep_cv_ty</span></a></span><span> </span><span class="annot"><span class="annottext">Type
</span><a href="#local-6989586621680848070"><span class="hs-identifier hs-var">ty</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-402"></span><span id="coVarsOfTypes"><span class="annot"><span class="annottext">coVarsOfTypes :: [Type] -&gt; VarSet
</span><a href="GHC.Core.TyCo.FVs.html#coVarsOfTypes"><span class="hs-identifier hs-var hs-var">coVarsOfTypes</span></a></span></span><span> </span><span id="local-6989586621680848068"><span class="annot"><span class="annottext">[Type]
</span><a href="#local-6989586621680848068"><span class="hs-identifier hs-var">tys</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Endo VarSet -&gt; VarSet
</span><a href="GHC.Core.TyCo.FVs.html#runTyCoVars"><span class="hs-identifier hs-var">runTyCoVars</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">[Type] -&gt; Endo VarSet
</span><a href="GHC.Core.TyCo.FVs.html#deep_cv_tys"><span class="hs-identifier hs-var">deep_cv_tys</span></a></span><span> </span><span class="annot"><span class="annottext">[Type]
</span><a href="#local-6989586621680848068"><span class="hs-identifier hs-var">tys</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-403"></span><span id="coVarsOfCo"><span class="annot"><span class="annottext">coVarsOfCo :: Coercion -&gt; VarSet
</span><a href="GHC.Core.TyCo.FVs.html#coVarsOfCo"><span class="hs-identifier hs-var hs-var">coVarsOfCo</span></a></span></span><span>    </span><span id="local-6989586621680848066"><span class="annot"><span class="annottext">Coercion
</span><a href="#local-6989586621680848066"><span class="hs-identifier hs-var">co</span></a></span></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Endo VarSet -&gt; VarSet
</span><a href="GHC.Core.TyCo.FVs.html#runTyCoVars"><span class="hs-identifier hs-var">runTyCoVars</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Coercion -&gt; Endo VarSet
</span><a href="GHC.Core.TyCo.FVs.html#deep_cv_co"><span class="hs-identifier hs-var">deep_cv_co</span></a></span><span> </span><span class="annot"><span class="annottext">Coercion
</span><a href="#local-6989586621680848066"><span class="hs-identifier hs-var">co</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-404"></span><span id="coVarsOfCos"><span class="annot"><span class="annottext">coVarsOfCos :: [Coercion] -&gt; VarSet
</span><a href="GHC.Core.TyCo.FVs.html#coVarsOfCos"><span class="hs-identifier hs-var hs-var">coVarsOfCos</span></a></span></span><span>   </span><span id="local-6989586621680848064"><span class="annot"><span class="annottext">[Coercion]
</span><a href="#local-6989586621680848064"><span class="hs-identifier hs-var">cos</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Endo VarSet -&gt; VarSet
</span><a href="GHC.Core.TyCo.FVs.html#runTyCoVars"><span class="hs-identifier hs-var">runTyCoVars</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">[Coercion] -&gt; Endo VarSet
</span><a href="GHC.Core.TyCo.FVs.html#deep_cv_cos"><span class="hs-identifier hs-var">deep_cv_cos</span></a></span><span> </span><span class="annot"><span class="annottext">[Coercion]
</span><a href="#local-6989586621680848064"><span class="hs-identifier hs-var">cos</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-405"></span><span>
</span><span id="line-406"></span><span class="annot"><a href="GHC.Core.TyCo.FVs.html#deep_cv_ty"><span class="hs-identifier hs-type">deep_cv_ty</span></a></span><span>  </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Core.TyCo.Rep.html#Type"><span class="hs-identifier hs-type">Type</span></a></span><span>       </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="../../base/src/Data.Semigroup.Internal.html#Endo"><span class="hs-identifier hs-type">Endo</span></a></span><span> </span><span class="annot"><a href="GHC.Types.Var.Set.html#CoVarSet"><span class="hs-identifier hs-type">CoVarSet</span></a></span><span>
</span><span id="line-407"></span><span class="annot"><a href="GHC.Core.TyCo.FVs.html#deep_cv_tys"><span class="hs-identifier hs-type">deep_cv_tys</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="hs-special">[</span><span class="annot"><a href="GHC.Core.TyCo.Rep.html#Type"><span class="hs-identifier hs-type">Type</span></a></span><span class="hs-special">]</span><span>     </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="../../base/src/Data.Semigroup.Internal.html#Endo"><span class="hs-identifier hs-type">Endo</span></a></span><span> </span><span class="annot"><a href="GHC.Types.Var.Set.html#CoVarSet"><span class="hs-identifier hs-type">CoVarSet</span></a></span><span>
</span><span id="line-408"></span><span class="annot"><a href="GHC.Core.TyCo.FVs.html#deep_cv_co"><span class="hs-identifier hs-type">deep_cv_co</span></a></span><span>  </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Core.TyCo.Rep.html#Coercion"><span class="hs-identifier hs-type">Coercion</span></a></span><span>   </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="../../base/src/Data.Semigroup.Internal.html#Endo"><span class="hs-identifier hs-type">Endo</span></a></span><span> </span><span class="annot"><a href="GHC.Types.Var.Set.html#CoVarSet"><span class="hs-identifier hs-type">CoVarSet</span></a></span><span>
</span><span id="line-409"></span><span class="annot"><a href="GHC.Core.TyCo.FVs.html#deep_cv_cos"><span class="hs-identifier hs-type">deep_cv_cos</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="hs-special">[</span><span class="annot"><a href="GHC.Core.TyCo.Rep.html#Coercion"><span class="hs-identifier hs-type">Coercion</span></a></span><span class="hs-special">]</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="../../base/src/Data.Semigroup.Internal.html#Endo"><span class="hs-identifier hs-type">Endo</span></a></span><span> </span><span class="annot"><a href="GHC.Types.Var.Set.html#CoVarSet"><span class="hs-identifier hs-type">CoVarSet</span></a></span><span>
</span><span id="line-410"></span><span class="hs-special">(</span><span id="deep_cv_ty"><span class="annot"><span class="annottext">Type -&gt; Endo VarSet
</span><a href="GHC.Core.TyCo.FVs.html#deep_cv_ty"><span class="hs-identifier hs-var">deep_cv_ty</span></a></span></span><span class="hs-special">,</span><span> </span><span id="deep_cv_tys"><span class="annot"><span class="annottext">[Type] -&gt; Endo VarSet
</span><a href="GHC.Core.TyCo.FVs.html#deep_cv_tys"><span class="hs-identifier hs-var">deep_cv_tys</span></a></span></span><span class="hs-special">,</span><span> </span><span id="deep_cv_co"><span class="annot"><span class="annottext">Coercion -&gt; Endo VarSet
</span><a href="GHC.Core.TyCo.FVs.html#deep_cv_co"><span class="hs-identifier hs-var">deep_cv_co</span></a></span></span><span class="hs-special">,</span><span> </span><span id="deep_cv_cos"><span class="annot"><span class="annottext">[Coercion] -&gt; Endo VarSet
</span><a href="GHC.Core.TyCo.FVs.html#deep_cv_cos"><span class="hs-identifier hs-var">deep_cv_cos</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">TyCoFolder VarSet (Endo VarSet)
-&gt; VarSet
-&gt; (Type -&gt; Endo VarSet, [Type] -&gt; Endo VarSet,
    Coercion -&gt; Endo VarSet, [Coercion] -&gt; Endo VarSet)
forall a env.
Monoid a =&gt;
TyCoFolder env a
-&gt; env -&gt; (Type -&gt; a, [Type] -&gt; a, Coercion -&gt; a, [Coercion] -&gt; a)
</span><a href="GHC.Core.TyCo.Rep.html#foldTyCo"><span class="hs-identifier hs-var">foldTyCo</span></a></span><span> </span><span class="annot"><span class="annottext">TyCoFolder VarSet (Endo VarSet)
</span><a href="GHC.Core.TyCo.FVs.html#deepCoVarFolder"><span class="hs-identifier hs-var">deepCoVarFolder</span></a></span><span> </span><span class="annot"><span class="annottext">VarSet
</span><a href="GHC.Types.Var.Set.html#emptyVarSet"><span class="hs-identifier hs-var">emptyVarSet</span></a></span><span>
</span><span id="line-411"></span><span>
</span><span id="line-412"></span><span class="annot"><a href="GHC.Core.TyCo.FVs.html#deepCoVarFolder"><span class="hs-identifier hs-type">deepCoVarFolder</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Core.TyCo.Rep.html#TyCoFolder"><span class="hs-identifier hs-type">TyCoFolder</span></a></span><span> </span><span class="annot"><a href="GHC.Types.Var.Set.html#TyCoVarSet"><span class="hs-identifier hs-type">TyCoVarSet</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="../../base/src/Data.Semigroup.Internal.html#Endo"><span class="hs-identifier hs-type">Endo</span></a></span><span> </span><span class="annot"><a href="GHC.Types.Var.Set.html#CoVarSet"><span class="hs-identifier hs-type">CoVarSet</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-413"></span><span id="deepCoVarFolder"><span class="annot"><span class="annottext">deepCoVarFolder :: TyCoFolder VarSet (Endo VarSet)
</span><a href="GHC.Core.TyCo.FVs.html#deepCoVarFolder"><span class="hs-identifier hs-var hs-var">deepCoVarFolder</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">TyCoFolder :: forall env a.
(Type -&gt; Maybe Type)
-&gt; (env -&gt; TyCoVar -&gt; a)
-&gt; (env -&gt; TyCoVar -&gt; a)
-&gt; (env -&gt; CoercionHole -&gt; a)
-&gt; (env -&gt; TyCoVar -&gt; ArgFlag -&gt; env)
-&gt; TyCoFolder env a
</span><a href="GHC.Core.TyCo.Rep.html#TyCoFolder"><span class="hs-identifier hs-type">TyCoFolder</span></a></span><span> </span><span class="hs-special">{</span><span> </span><span class="annot"><span class="annottext">tcf_view :: Type -&gt; Maybe Type
</span><a href="GHC.Core.TyCo.Rep.html#tcf_view"><span class="hs-identifier hs-var">tcf_view</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Type -&gt; Maybe Type
</span><a href="GHC.Core.TyCo.FVs.html#noView"><span class="hs-identifier hs-var">noView</span></a></span><span>
</span><span id="line-414"></span><span>                             </span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">tcf_tyvar :: VarSet -&gt; TyCoVar -&gt; Endo VarSet
</span><a href="GHC.Core.TyCo.Rep.html#tcf_tyvar"><span class="hs-identifier hs-var">tcf_tyvar</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">VarSet -&gt; TyCoVar -&gt; Endo VarSet
forall {a} {p} {p}. Monoid a =&gt; p -&gt; p -&gt; a
</span><a href="#local-6989586621680848060"><span class="hs-identifier hs-var">do_tyvar</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">tcf_covar :: VarSet -&gt; TyCoVar -&gt; Endo VarSet
</span><a href="GHC.Core.TyCo.Rep.html#tcf_covar"><span class="hs-identifier hs-var">tcf_covar</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">VarSet -&gt; TyCoVar -&gt; Endo VarSet
</span><a href="#local-6989586621680848059"><span class="hs-identifier hs-var">do_covar</span></a></span><span>
</span><span id="line-415"></span><span>                             </span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">tcf_hole :: VarSet -&gt; CoercionHole -&gt; Endo VarSet
</span><a href="GHC.Core.TyCo.Rep.html#tcf_hole"><span class="hs-identifier hs-var">tcf_hole</span></a></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">VarSet -&gt; CoercionHole -&gt; Endo VarSet
</span><a href="#local-6989586621680848058"><span class="hs-identifier hs-var">do_hole</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">tcf_tycobinder :: VarSet -&gt; TyCoVar -&gt; ArgFlag -&gt; VarSet
</span><a href="GHC.Core.TyCo.Rep.html#tcf_tycobinder"><span class="hs-identifier hs-var">tcf_tycobinder</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">VarSet -&gt; TyCoVar -&gt; ArgFlag -&gt; VarSet
forall {p}. VarSet -&gt; TyCoVar -&gt; p -&gt; VarSet
</span><a href="#local-6989586621680848057"><span class="hs-identifier hs-var">do_bndr</span></a></span><span> </span><span class="hs-special">}</span><span>
</span><span id="line-416"></span><span>  </span><span class="hs-keyword">where</span><span>
</span><span id="line-417"></span><span>    </span><span id="local-6989586621680848060"><span class="annot"><span class="annottext">do_tyvar :: p -&gt; p -&gt; a
</span><a href="#local-6989586621680848060"><span class="hs-identifier hs-var hs-var">do_tyvar</span></a></span></span><span> </span><span class="annot"><span class="annottext">p
</span><span class="hs-identifier">_</span></span><span> </span><span class="annot"><span class="annottext">p
</span><span class="hs-identifier">_</span></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">a
forall a. Monoid a =&gt; a
</span><a href="../../base/src/GHC.Base.html#mempty"><span class="hs-identifier hs-var">mempty</span></a></span><span>
</span><span id="line-418"></span><span>      </span><span class="hs-comment">-- This do_tyvar means we won't see any CoVars in this</span><span>
</span><span id="line-419"></span><span>      </span><span class="hs-comment">-- TyVar's kind.   This may be wrong; but it's the way it's</span><span>
</span><span id="line-420"></span><span>      </span><span class="hs-comment">-- always been.  And its awkward to change, because</span><span>
</span><span id="line-421"></span><span>      </span><span class="hs-comment">-- the tyvar won't end up in the accumulator, so</span><span>
</span><span id="line-422"></span><span>      </span><span class="hs-comment">-- we'd look repeatedly.  Blargh.</span><span>
</span><span id="line-423"></span><span>
</span><span id="line-424"></span><span>    </span><span id="local-6989586621680848059"><span class="annot"><span class="annottext">do_covar :: VarSet -&gt; TyCoVar -&gt; Endo VarSet
</span><a href="#local-6989586621680848059"><span class="hs-identifier hs-var hs-var">do_covar</span></a></span></span><span> </span><span id="local-6989586621680848054"><span class="annot"><span class="annottext">VarSet
</span><a href="#local-6989586621680848054"><span class="hs-identifier hs-var">is</span></a></span></span><span> </span><span id="local-6989586621680848053"><span class="annot"><span class="annottext">TyCoVar
</span><a href="#local-6989586621680848053"><span class="hs-identifier hs-var">v</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">(VarSet -&gt; VarSet) -&gt; Endo VarSet
forall a. (a -&gt; a) -&gt; Endo a
</span><a href="../../base/src/Data.Semigroup.Internal.html#Endo"><span class="hs-identifier hs-var">Endo</span></a></span><span> </span><span class="annot"><span class="annottext">VarSet -&gt; VarSet
</span><a href="#local-6989586621680848052"><span class="hs-identifier hs-var">do_it</span></a></span><span>
</span><span id="line-425"></span><span>      </span><span class="hs-keyword">where</span><span>
</span><span id="line-426"></span><span>        </span><span id="local-6989586621680848052"><span class="annot"><span class="annottext">do_it :: VarSet -&gt; VarSet
</span><a href="#local-6989586621680848052"><span class="hs-identifier hs-var hs-var">do_it</span></a></span></span><span> </span><span id="local-6989586621680848051"><span class="annot"><span class="annottext">VarSet
</span><a href="#local-6989586621680848051"><span class="hs-identifier hs-var">acc</span></a></span></span><span> </span><span class="hs-glyph">|</span><span> </span><span class="annot"><span class="annottext">TyCoVar
</span><a href="#local-6989586621680848053"><span class="hs-identifier hs-var">v</span></a></span><span> </span><span class="annot"><span class="annottext">TyCoVar -&gt; VarSet -&gt; Bool
</span><a href="GHC.Types.Var.Set.html#elemVarSet"><span class="hs-operator hs-var">`elemVarSet`</span></a></span><span> </span><span class="annot"><span class="annottext">VarSet
</span><a href="#local-6989586621680848054"><span class="hs-identifier hs-var">is</span></a></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">VarSet
</span><a href="#local-6989586621680848051"><span class="hs-identifier hs-var">acc</span></a></span><span>
</span><span id="line-427"></span><span>                  </span><span class="hs-glyph">|</span><span> </span><span class="annot"><span class="annottext">TyCoVar
</span><a href="#local-6989586621680848053"><span class="hs-identifier hs-var">v</span></a></span><span> </span><span class="annot"><span class="annottext">TyCoVar -&gt; VarSet -&gt; Bool
</span><a href="GHC.Types.Var.Set.html#elemVarSet"><span class="hs-operator hs-var">`elemVarSet`</span></a></span><span> </span><span class="annot"><span class="annottext">VarSet
</span><a href="#local-6989586621680848051"><span class="hs-identifier hs-var">acc</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">VarSet
</span><a href="#local-6989586621680848051"><span class="hs-identifier hs-var">acc</span></a></span><span>
</span><span id="line-428"></span><span>                  </span><span class="hs-glyph">|</span><span> </span><span class="annot"><span class="annottext">Bool
</span><a href="../../base/src/GHC.Base.html#otherwise"><span class="hs-identifier hs-var">otherwise</span></a></span><span>          </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Endo VarSet -&gt; VarSet -&gt; VarSet
forall a. Endo a -&gt; a -&gt; a
</span><a href="../../base/src/Data.Semigroup.Internal.html#appEndo"><span class="hs-identifier hs-var hs-var">appEndo</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Type -&gt; Endo VarSet
</span><a href="GHC.Core.TyCo.FVs.html#deep_cv_ty"><span class="hs-identifier hs-var">deep_cv_ty</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">TyCoVar -&gt; Type
</span><a href="GHC.Types.Var.html#varType"><span class="hs-identifier hs-var hs-var">varType</span></a></span><span> </span><span class="annot"><span class="annottext">TyCoVar
</span><a href="#local-6989586621680848053"><span class="hs-identifier hs-var">v</span></a></span><span class="hs-special">)</span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">(VarSet -&gt; VarSet) -&gt; VarSet -&gt; VarSet
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span>
</span><span id="line-429"></span><span>                                         </span><span class="annot"><span class="annottext">VarSet
</span><a href="#local-6989586621680848051"><span class="hs-identifier hs-var">acc</span></a></span><span> </span><span class="annot"><span class="annottext">VarSet -&gt; TyCoVar -&gt; VarSet
</span><a href="GHC.Types.Var.Set.html#extendVarSet"><span class="hs-operator hs-var">`extendVarSet`</span></a></span><span> </span><span class="annot"><span class="annottext">TyCoVar
</span><a href="#local-6989586621680848053"><span class="hs-identifier hs-var">v</span></a></span><span>
</span><span id="line-430"></span><span>
</span><span id="line-431"></span><span>    </span><span id="local-6989586621680848057"><span class="annot"><span class="annottext">do_bndr :: VarSet -&gt; TyCoVar -&gt; p -&gt; VarSet
</span><a href="#local-6989586621680848057"><span class="hs-identifier hs-var hs-var">do_bndr</span></a></span></span><span> </span><span id="local-6989586621680848050"><span class="annot"><span class="annottext">VarSet
</span><a href="#local-6989586621680848050"><span class="hs-identifier hs-var">is</span></a></span></span><span> </span><span id="local-6989586621680848049"><span class="annot"><span class="annottext">TyCoVar
</span><a href="#local-6989586621680848049"><span class="hs-identifier hs-var">tcv</span></a></span></span><span> </span><span class="annot"><span class="annottext">p
</span><span class="hs-identifier">_</span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">VarSet -&gt; TyCoVar -&gt; VarSet
</span><a href="GHC.Types.Var.Set.html#extendVarSet"><span class="hs-identifier hs-var">extendVarSet</span></a></span><span> </span><span class="annot"><span class="annottext">VarSet
</span><a href="#local-6989586621680848050"><span class="hs-identifier hs-var">is</span></a></span><span> </span><span class="annot"><span class="annottext">TyCoVar
</span><a href="#local-6989586621680848049"><span class="hs-identifier hs-var">tcv</span></a></span><span>
</span><span id="line-432"></span><span>    </span><span id="local-6989586621680848058"><span class="annot"><span class="annottext">do_hole :: VarSet -&gt; CoercionHole -&gt; Endo VarSet
</span><a href="#local-6989586621680848058"><span class="hs-identifier hs-var hs-var">do_hole</span></a></span></span><span> </span><span id="local-6989586621680848048"><span class="annot"><span class="annottext">VarSet
</span><a href="#local-6989586621680848048"><span class="hs-identifier hs-var">is</span></a></span></span><span> </span><span id="local-6989586621680848047"><span class="annot"><span class="annottext">CoercionHole
</span><a href="#local-6989586621680848047"><span class="hs-identifier hs-var">hole</span></a></span></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">VarSet -&gt; TyCoVar -&gt; Endo VarSet
</span><a href="#local-6989586621680848059"><span class="hs-identifier hs-var">do_covar</span></a></span><span> </span><span class="annot"><span class="annottext">VarSet
</span><a href="#local-6989586621680848048"><span class="hs-identifier hs-var">is</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">CoercionHole -&gt; TyCoVar
</span><a href="GHC.Core.TyCo.Rep.html#coHoleCoVar"><span class="hs-identifier hs-var">coHoleCoVar</span></a></span><span> </span><span class="annot"><span class="annottext">CoercionHole
</span><a href="#local-6989586621680848047"><span class="hs-identifier hs-var">hole</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-433"></span><span>                       </span><span class="hs-comment">-- See Note [CoercionHoles and coercion free variables]</span><span>
</span><span id="line-434"></span><span>                       </span><span class="hs-comment">-- in GHC.Core.TyCo.Rep</span><span>
</span><span id="line-435"></span><span>
</span><span id="line-436"></span><span>
</span><span id="line-437"></span><span class="hs-comment">{- *********************************************************************
*                                                                      *
          Closing over kinds
*                                                                      *
********************************************************************* -}</span><span>
</span><span id="line-442"></span><span>
</span><span id="line-443"></span><span class="hs-comment">------------- Closing over kinds -----------------</span><span>
</span><span id="line-444"></span><span>
</span><span id="line-445"></span><span class="annot"><a href="GHC.Core.TyCo.FVs.html#closeOverKinds"><span class="hs-identifier hs-type">closeOverKinds</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Types.Var.Set.html#TyCoVarSet"><span class="hs-identifier hs-type">TyCoVarSet</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Types.Var.Set.html#TyCoVarSet"><span class="hs-identifier hs-type">TyCoVarSet</span></a></span><span>
</span><span id="line-446"></span><span class="hs-comment">-- For each element of the input set,</span><span>
</span><span id="line-447"></span><span class="hs-comment">-- add the deep free variables of its kind</span><span>
</span><span id="line-448"></span><span id="closeOverKinds"><span class="annot"><span class="annottext">closeOverKinds :: VarSet -&gt; VarSet
</span><a href="GHC.Core.TyCo.FVs.html#closeOverKinds"><span class="hs-identifier hs-var hs-var">closeOverKinds</span></a></span></span><span> </span><span id="local-6989586621680848046"><span class="annot"><span class="annottext">VarSet
</span><a href="#local-6989586621680848046"><span class="hs-identifier hs-var">vs</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">(TyCoVar -&gt; VarSet -&gt; VarSet) -&gt; VarSet -&gt; VarSet -&gt; VarSet
forall a. (TyCoVar -&gt; a -&gt; a) -&gt; a -&gt; VarSet -&gt; a
</span><a href="GHC.Types.Var.Set.html#nonDetStrictFoldVarSet"><span class="hs-identifier hs-var">nonDetStrictFoldVarSet</span></a></span><span> </span><span class="annot"><span class="annottext">TyCoVar -&gt; VarSet -&gt; VarSet
</span><a href="#local-6989586621680848044"><span class="hs-identifier hs-var">do_one</span></a></span><span> </span><span class="annot"><span class="annottext">VarSet
</span><a href="#local-6989586621680848046"><span class="hs-identifier hs-var">vs</span></a></span><span> </span><span class="annot"><span class="annottext">VarSet
</span><a href="#local-6989586621680848046"><span class="hs-identifier hs-var">vs</span></a></span><span>
</span><span id="line-449"></span><span>  </span><span class="hs-keyword">where</span><span>
</span><span id="line-450"></span><span>    </span><span id="local-6989586621680848044"><span class="annot"><span class="annottext">do_one :: TyCoVar -&gt; VarSet -&gt; VarSet
</span><a href="#local-6989586621680848044"><span class="hs-identifier hs-var hs-var">do_one</span></a></span></span><span> </span><span id="local-6989586621680848043"><span class="annot"><span class="annottext">TyCoVar
</span><a href="#local-6989586621680848043"><span class="hs-identifier hs-var">v</span></a></span></span><span> </span><span id="local-6989586621680848042"><span class="annot"><span class="annottext">VarSet
</span><a href="#local-6989586621680848042"><span class="hs-identifier hs-var">acc</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Endo VarSet -&gt; VarSet -&gt; VarSet
forall a. Endo a -&gt; a -&gt; a
</span><a href="../../base/src/Data.Semigroup.Internal.html#appEndo"><span class="hs-identifier hs-var hs-var">appEndo</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Type -&gt; Endo VarSet
</span><a href="GHC.Core.TyCo.FVs.html#deep_ty"><span class="hs-identifier hs-var">deep_ty</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">TyCoVar -&gt; Type
</span><a href="GHC.Types.Var.html#varType"><span class="hs-identifier hs-var hs-var">varType</span></a></span><span> </span><span class="annot"><span class="annottext">TyCoVar
</span><a href="#local-6989586621680848043"><span class="hs-identifier hs-var">v</span></a></span><span class="hs-special">)</span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">VarSet
</span><a href="#local-6989586621680848042"><span class="hs-identifier hs-var">acc</span></a></span><span>
</span><span id="line-451"></span><span>
</span><span id="line-452"></span><span class="hs-comment">{- --------------- Alternative version 1 (using FV) ------------
closeOverKinds = fvVarSet . closeOverKindsFV . nonDetEltsUniqSet
-}</span><span>
</span><span id="line-455"></span><span>
</span><span id="line-456"></span><span class="hs-comment">{- ---------------- Alternative version 2 -------------

-- | Add the kind variables free in the kinds of the tyvars in the given set.
-- Returns a non-deterministic set.
closeOverKinds :: TyCoVarSet -&gt; TyCoVarSet
closeOverKinds vs
   = go vs vs
  where
    go :: VarSet   -- Work list
       -&gt; VarSet   -- Accumulator, always a superset of wl
       -&gt; VarSet
    go wl acc
      | isEmptyVarSet wl = acc
      | otherwise        = go wl_kvs (acc `unionVarSet` wl_kvs)
      where
        k v inner_acc = ty_co_vars_of_type (varType v) acc inner_acc
        wl_kvs = nonDetFoldVarSet k emptyVarSet wl
        -- wl_kvs = union of shallow free vars of the kinds of wl
        --          but don't bother to collect vars in acc

-}</span><span>
</span><span id="line-477"></span><span>
</span><span id="line-478"></span><span class="hs-comment">{- ---------------- Alternative version 3 -------------
-- | Add the kind variables free in the kinds of the tyvars in the given set.
-- Returns a non-deterministic set.
closeOverKinds :: TyVarSet -&gt; TyVarSet
closeOverKinds vs = close_over_kinds vs emptyVarSet


close_over_kinds :: TyVarSet  -- Work list
                 -&gt; TyVarSet  -- Accumulator
                 -&gt; TyVarSet
-- Precondition: in any call (close_over_kinds wl acc)
--  for every tv in acc, the shallow kind-vars of tv
--  are either in the work list wl, or in acc
-- Postcondition: result is the deep free vars of (wl `union` acc)
close_over_kinds wl acc
  = nonDetFoldVarSet do_one acc wl
  where
    do_one :: Var -&gt; TyVarSet -&gt; TyVarSet
    -- (do_one v acc) adds v and its deep free-vars to acc
    do_one v acc | v `elemVarSet` acc
                 = acc
                 | otherwise
                 = close_over_kinds (shallowTyCoVarsOfType (varType v)) $
                   acc `extendVarSet` v
-}</span><span>
</span><span id="line-503"></span><span>
</span><span id="line-504"></span><span>
</span><span id="line-505"></span><span class="hs-comment">{- *********************************************************************
*                                                                      *
          The FV versions return deterministic results
*                                                                      *
********************************************************************* -}</span><span>
</span><span id="line-510"></span><span>
</span><span id="line-511"></span><span class="hs-comment">-- | Given a list of tyvars returns a deterministic FV computation that</span><span>
</span><span id="line-512"></span><span class="hs-comment">-- returns the given tyvars with the kind variables free in the kinds of the</span><span>
</span><span id="line-513"></span><span class="hs-comment">-- given tyvars.</span><span>
</span><span id="line-514"></span><span class="annot"><a href="GHC.Core.TyCo.FVs.html#closeOverKindsFV"><span class="hs-identifier hs-type">closeOverKindsFV</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="hs-special">[</span><span class="annot"><a href="GHC.Types.Var.html#TyVar"><span class="hs-identifier hs-type">TyVar</span></a></span><span class="hs-special">]</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Utils.FV.html#FV"><span class="hs-identifier hs-type">FV</span></a></span><span>
</span><span id="line-515"></span><span id="closeOverKindsFV"><span class="annot"><span class="annottext">closeOverKindsFV :: [TyCoVar] -&gt; FV
</span><a href="GHC.Core.TyCo.FVs.html#closeOverKindsFV"><span class="hs-identifier hs-var hs-var">closeOverKindsFV</span></a></span></span><span> </span><span id="local-6989586621680848039"><span class="annot"><span class="annottext">[TyCoVar]
</span><a href="#local-6989586621680848039"><span class="hs-identifier hs-var">tvs</span></a></span></span><span> </span><span class="hs-glyph">=</span><span>
</span><span id="line-516"></span><span>  </span><span class="annot"><span class="annottext">(TyCoVar -&gt; FV) -&gt; [TyCoVar] -&gt; FV
forall a. (a -&gt; FV) -&gt; [a] -&gt; FV
</span><a href="GHC.Utils.FV.html#mapUnionFV"><span class="hs-identifier hs-var">mapUnionFV</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Type -&gt; FV
</span><a href="GHC.Core.TyCo.FVs.html#tyCoFVsOfType"><span class="hs-identifier hs-var">tyCoFVsOfType</span></a></span><span> </span><span class="annot"><span class="annottext">(Type -&gt; FV) -&gt; (TyCoVar -&gt; Type) -&gt; TyCoVar -&gt; FV
forall b c a. (b -&gt; c) -&gt; (a -&gt; b) -&gt; a -&gt; c
</span><a href="../../base/src/GHC.Base.html#."><span class="hs-operator hs-var">.</span></a></span><span> </span><span class="annot"><span class="annottext">TyCoVar -&gt; Type
</span><a href="GHC.Types.Var.html#tyVarKind"><span class="hs-identifier hs-var">tyVarKind</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">[TyCoVar]
</span><a href="#local-6989586621680848039"><span class="hs-identifier hs-var">tvs</span></a></span><span> </span><span class="annot"><span class="annottext">FV -&gt; FV -&gt; FV
</span><a href="GHC.Utils.FV.html#unionFV"><span class="hs-operator hs-var">`unionFV`</span></a></span><span> </span><span class="annot"><span class="annottext">[TyCoVar] -&gt; FV
</span><a href="GHC.Utils.FV.html#mkFVs"><span class="hs-identifier hs-var">mkFVs</span></a></span><span> </span><span class="annot"><span class="annottext">[TyCoVar]
</span><a href="#local-6989586621680848039"><span class="hs-identifier hs-var">tvs</span></a></span><span>
</span><span id="line-517"></span><span>
</span><span id="line-518"></span><span class="hs-comment">-- | Add the kind variables free in the kinds of the tyvars in the given set.</span><span>
</span><span id="line-519"></span><span class="hs-comment">-- Returns a deterministically ordered list.</span><span>
</span><span id="line-520"></span><span class="annot"><a href="GHC.Core.TyCo.FVs.html#closeOverKindsList"><span class="hs-identifier hs-type">closeOverKindsList</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="hs-special">[</span><span class="annot"><a href="GHC.Types.Var.html#TyVar"><span class="hs-identifier hs-type">TyVar</span></a></span><span class="hs-special">]</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">[</span><span class="annot"><a href="GHC.Types.Var.html#TyVar"><span class="hs-identifier hs-type">TyVar</span></a></span><span class="hs-special">]</span><span>
</span><span id="line-521"></span><span id="closeOverKindsList"><span class="annot"><span class="annottext">closeOverKindsList :: [TyCoVar] -&gt; [TyCoVar]
</span><a href="GHC.Core.TyCo.FVs.html#closeOverKindsList"><span class="hs-identifier hs-var hs-var">closeOverKindsList</span></a></span></span><span> </span><span id="local-6989586621680848033"><span class="annot"><span class="annottext">[TyCoVar]
</span><a href="#local-6989586621680848033"><span class="hs-identifier hs-var">tvs</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">FV -&gt; [TyCoVar]
</span><a href="GHC.Utils.FV.html#fvVarList"><span class="hs-identifier hs-var">fvVarList</span></a></span><span> </span><span class="annot"><span class="annottext">(FV -&gt; [TyCoVar]) -&gt; FV -&gt; [TyCoVar]
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="annot"><span class="annottext">[TyCoVar] -&gt; FV
</span><a href="GHC.Core.TyCo.FVs.html#closeOverKindsFV"><span class="hs-identifier hs-var">closeOverKindsFV</span></a></span><span> </span><span class="annot"><span class="annottext">[TyCoVar]
</span><a href="#local-6989586621680848033"><span class="hs-identifier hs-var">tvs</span></a></span><span>
</span><span id="line-522"></span><span>
</span><span id="line-523"></span><span class="hs-comment">-- | Add the kind variables free in the kinds of the tyvars in the given set.</span><span>
</span><span id="line-524"></span><span class="hs-comment">-- Returns a deterministic set.</span><span>
</span><span id="line-525"></span><span class="annot"><a href="GHC.Core.TyCo.FVs.html#closeOverKindsDSet"><span class="hs-identifier hs-type">closeOverKindsDSet</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Types.Var.Set.html#DTyVarSet"><span class="hs-identifier hs-type">DTyVarSet</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Types.Var.Set.html#DTyVarSet"><span class="hs-identifier hs-type">DTyVarSet</span></a></span><span>
</span><span id="line-526"></span><span id="closeOverKindsDSet"><span class="annot"><span class="annottext">closeOverKindsDSet :: DTyVarSet -&gt; DTyVarSet
</span><a href="GHC.Core.TyCo.FVs.html#closeOverKindsDSet"><span class="hs-identifier hs-var hs-var">closeOverKindsDSet</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">FV -&gt; DTyVarSet
</span><a href="GHC.Utils.FV.html#fvDVarSet"><span class="hs-identifier hs-var">fvDVarSet</span></a></span><span> </span><span class="annot"><span class="annottext">(FV -&gt; DTyVarSet) -&gt; (DTyVarSet -&gt; FV) -&gt; DTyVarSet -&gt; DTyVarSet
forall b c a. (b -&gt; c) -&gt; (a -&gt; b) -&gt; a -&gt; c
</span><a href="../../base/src/GHC.Base.html#."><span class="hs-operator hs-var">.</span></a></span><span> </span><span class="annot"><span class="annottext">[TyCoVar] -&gt; FV
</span><a href="GHC.Core.TyCo.FVs.html#closeOverKindsFV"><span class="hs-identifier hs-var">closeOverKindsFV</span></a></span><span> </span><span class="annot"><span class="annottext">([TyCoVar] -&gt; FV) -&gt; (DTyVarSet -&gt; [TyCoVar]) -&gt; DTyVarSet -&gt; FV
forall b c a. (b -&gt; c) -&gt; (a -&gt; b) -&gt; a -&gt; c
</span><a href="../../base/src/GHC.Base.html#."><span class="hs-operator hs-var">.</span></a></span><span> </span><span class="annot"><span class="annottext">DTyVarSet -&gt; [TyCoVar]
</span><a href="GHC.Types.Var.Set.html#dVarSetElems"><span class="hs-identifier hs-var">dVarSetElems</span></a></span><span>
</span><span id="line-527"></span><span>
</span><span id="line-528"></span><span class="hs-comment">-- | `tyCoFVsOfType` that returns free variables of a type in a deterministic</span><span>
</span><span id="line-529"></span><span class="hs-comment">-- set. For explanation of why using `VarSet` is not deterministic see</span><span>
</span><span id="line-530"></span><span class="hs-comment">-- Note [Deterministic FV] in &quot;GHC.Utils.FV&quot;.</span><span>
</span><span id="line-531"></span><span class="annot"><a href="GHC.Core.TyCo.FVs.html#tyCoVarsOfTypeDSet"><span class="hs-identifier hs-type">tyCoVarsOfTypeDSet</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Core.TyCo.Rep.html#Type"><span class="hs-identifier hs-type">Type</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Types.Var.Set.html#DTyCoVarSet"><span class="hs-identifier hs-type">DTyCoVarSet</span></a></span><span>
</span><span id="line-532"></span><span class="hs-comment">-- See Note [Free variables of types]</span><span>
</span><span id="line-533"></span><span id="tyCoVarsOfTypeDSet"><span class="annot"><span class="annottext">tyCoVarsOfTypeDSet :: Type -&gt; DTyVarSet
</span><a href="GHC.Core.TyCo.FVs.html#tyCoVarsOfTypeDSet"><span class="hs-identifier hs-var hs-var">tyCoVarsOfTypeDSet</span></a></span></span><span> </span><span id="local-6989586621680848028"><span class="annot"><span class="annottext">Type
</span><a href="#local-6989586621680848028"><span class="hs-identifier hs-var">ty</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">FV -&gt; DTyVarSet
</span><a href="GHC.Utils.FV.html#fvDVarSet"><span class="hs-identifier hs-var">fvDVarSet</span></a></span><span> </span><span class="annot"><span class="annottext">(FV -&gt; DTyVarSet) -&gt; FV -&gt; DTyVarSet
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="annot"><span class="annottext">Type -&gt; FV
</span><a href="GHC.Core.TyCo.FVs.html#tyCoFVsOfType"><span class="hs-identifier hs-var">tyCoFVsOfType</span></a></span><span> </span><span class="annot"><span class="annottext">Type
</span><a href="#local-6989586621680848028"><span class="hs-identifier hs-var">ty</span></a></span><span>
</span><span id="line-534"></span><span>
</span><span id="line-535"></span><span class="hs-comment">-- | `tyCoFVsOfType` that returns free variables of a type in deterministic</span><span>
</span><span id="line-536"></span><span class="hs-comment">-- order. For explanation of why using `VarSet` is not deterministic see</span><span>
</span><span id="line-537"></span><span class="hs-comment">-- Note [Deterministic FV] in &quot;GHC.Utils.FV&quot;.</span><span>
</span><span id="line-538"></span><span class="annot"><a href="GHC.Core.TyCo.FVs.html#tyCoVarsOfTypeList"><span class="hs-identifier hs-type">tyCoVarsOfTypeList</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Core.TyCo.Rep.html#Type"><span class="hs-identifier hs-type">Type</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">[</span><span class="annot"><a href="GHC.Types.Var.html#TyCoVar"><span class="hs-identifier hs-type">TyCoVar</span></a></span><span class="hs-special">]</span><span>
</span><span id="line-539"></span><span class="hs-comment">-- See Note [Free variables of types]</span><span>
</span><span id="line-540"></span><span id="tyCoVarsOfTypeList"><span class="annot"><span class="annottext">tyCoVarsOfTypeList :: Type -&gt; [TyCoVar]
</span><a href="GHC.Core.TyCo.FVs.html#tyCoVarsOfTypeList"><span class="hs-identifier hs-var hs-var">tyCoVarsOfTypeList</span></a></span></span><span> </span><span id="local-6989586621680848027"><span class="annot"><span class="annottext">Type
</span><a href="#local-6989586621680848027"><span class="hs-identifier hs-var">ty</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">FV -&gt; [TyCoVar]
</span><a href="GHC.Utils.FV.html#fvVarList"><span class="hs-identifier hs-var">fvVarList</span></a></span><span> </span><span class="annot"><span class="annottext">(FV -&gt; [TyCoVar]) -&gt; FV -&gt; [TyCoVar]
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="annot"><span class="annottext">Type -&gt; FV
</span><a href="GHC.Core.TyCo.FVs.html#tyCoFVsOfType"><span class="hs-identifier hs-var">tyCoFVsOfType</span></a></span><span> </span><span class="annot"><span class="annottext">Type
</span><a href="#local-6989586621680848027"><span class="hs-identifier hs-var">ty</span></a></span><span>
</span><span id="line-541"></span><span>
</span><span id="line-542"></span><span class="hs-comment">-- | Returns free variables of types, including kind variables as</span><span>
</span><span id="line-543"></span><span class="hs-comment">-- a deterministic set. For type synonyms it does /not/ expand the</span><span>
</span><span id="line-544"></span><span class="hs-comment">-- synonym.</span><span>
</span><span id="line-545"></span><span class="annot"><a href="GHC.Core.TyCo.FVs.html#tyCoVarsOfTypesDSet"><span class="hs-identifier hs-type">tyCoVarsOfTypesDSet</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="hs-special">[</span><span class="annot"><a href="GHC.Core.TyCo.Rep.html#Type"><span class="hs-identifier hs-type">Type</span></a></span><span class="hs-special">]</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Types.Var.Set.html#DTyCoVarSet"><span class="hs-identifier hs-type">DTyCoVarSet</span></a></span><span>
</span><span id="line-546"></span><span class="hs-comment">-- See Note [Free variables of types]</span><span>
</span><span id="line-547"></span><span id="tyCoVarsOfTypesDSet"><span class="annot"><span class="annottext">tyCoVarsOfTypesDSet :: [Type] -&gt; DTyVarSet
</span><a href="GHC.Core.TyCo.FVs.html#tyCoVarsOfTypesDSet"><span class="hs-identifier hs-var hs-var">tyCoVarsOfTypesDSet</span></a></span></span><span> </span><span id="local-6989586621680848026"><span class="annot"><span class="annottext">[Type]
</span><a href="#local-6989586621680848026"><span class="hs-identifier hs-var">tys</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">FV -&gt; DTyVarSet
</span><a href="GHC.Utils.FV.html#fvDVarSet"><span class="hs-identifier hs-var">fvDVarSet</span></a></span><span> </span><span class="annot"><span class="annottext">(FV -&gt; DTyVarSet) -&gt; FV -&gt; DTyVarSet
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="annot"><span class="annottext">[Type] -&gt; FV
</span><a href="GHC.Core.TyCo.FVs.html#tyCoFVsOfTypes"><span class="hs-identifier hs-var">tyCoFVsOfTypes</span></a></span><span> </span><span class="annot"><span class="annottext">[Type]
</span><a href="#local-6989586621680848026"><span class="hs-identifier hs-var">tys</span></a></span><span>
</span><span id="line-548"></span><span>
</span><span id="line-549"></span><span class="hs-comment">-- | Returns free variables of types, including kind variables as</span><span>
</span><span id="line-550"></span><span class="hs-comment">-- a deterministically ordered list. For type synonyms it does /not/ expand the</span><span>
</span><span id="line-551"></span><span class="hs-comment">-- synonym.</span><span>
</span><span id="line-552"></span><span class="annot"><a href="GHC.Core.TyCo.FVs.html#tyCoVarsOfTypesList"><span class="hs-identifier hs-type">tyCoVarsOfTypesList</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="hs-special">[</span><span class="annot"><a href="GHC.Core.TyCo.Rep.html#Type"><span class="hs-identifier hs-type">Type</span></a></span><span class="hs-special">]</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">[</span><span class="annot"><a href="GHC.Types.Var.html#TyCoVar"><span class="hs-identifier hs-type">TyCoVar</span></a></span><span class="hs-special">]</span><span>
</span><span id="line-553"></span><span class="hs-comment">-- See Note [Free variables of types]</span><span>
</span><span id="line-554"></span><span id="tyCoVarsOfTypesList"><span class="annot"><span class="annottext">tyCoVarsOfTypesList :: [Type] -&gt; [TyCoVar]
</span><a href="GHC.Core.TyCo.FVs.html#tyCoVarsOfTypesList"><span class="hs-identifier hs-var hs-var">tyCoVarsOfTypesList</span></a></span></span><span> </span><span id="local-6989586621680848025"><span class="annot"><span class="annottext">[Type]
</span><a href="#local-6989586621680848025"><span class="hs-identifier hs-var">tys</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">FV -&gt; [TyCoVar]
</span><a href="GHC.Utils.FV.html#fvVarList"><span class="hs-identifier hs-var">fvVarList</span></a></span><span> </span><span class="annot"><span class="annottext">(FV -&gt; [TyCoVar]) -&gt; FV -&gt; [TyCoVar]
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="annot"><span class="annottext">[Type] -&gt; FV
</span><a href="GHC.Core.TyCo.FVs.html#tyCoFVsOfTypes"><span class="hs-identifier hs-var">tyCoFVsOfTypes</span></a></span><span> </span><span class="annot"><span class="annottext">[Type]
</span><a href="#local-6989586621680848025"><span class="hs-identifier hs-var">tys</span></a></span><span>
</span><span id="line-555"></span><span>
</span><span id="line-556"></span><span class="hs-comment">-- | The worker for `tyCoFVsOfType` and `tyCoFVsOfTypeList`.</span><span>
</span><span id="line-557"></span><span class="hs-comment">-- The previous implementation used `unionVarSet` which is O(n+m) and can</span><span>
</span><span id="line-558"></span><span class="hs-comment">-- make the function quadratic.</span><span>
</span><span id="line-559"></span><span class="hs-comment">-- It's exported, so that it can be composed with</span><span>
</span><span id="line-560"></span><span class="hs-comment">-- other functions that compute free variables.</span><span>
</span><span id="line-561"></span><span class="hs-comment">-- See Note [FV naming conventions] in &quot;GHC.Utils.FV&quot;.</span><span>
</span><span id="line-562"></span><span class="hs-comment">--</span><span>
</span><span id="line-563"></span><span class="hs-comment">-- Eta-expanded because that makes it run faster (apparently)</span><span>
</span><span id="line-564"></span><span class="hs-comment">-- See Note [FV eta expansion] in &quot;GHC.Utils.FV&quot; for explanation.</span><span>
</span><span id="line-565"></span><span class="annot"><a href="GHC.Core.TyCo.FVs.html#tyCoFVsOfType"><span class="hs-identifier hs-type">tyCoFVsOfType</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Core.TyCo.Rep.html#Type"><span class="hs-identifier hs-type">Type</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Utils.FV.html#FV"><span class="hs-identifier hs-type">FV</span></a></span><span>
</span><span id="line-566"></span><span class="hs-comment">-- See Note [Free variables of types]</span><span>
</span><span id="line-567"></span><span id="tyCoFVsOfType"><span class="annot"><span class="annottext">tyCoFVsOfType :: Type -&gt; FV
</span><a href="GHC.Core.TyCo.FVs.html#tyCoFVsOfType"><span class="hs-identifier hs-var hs-var">tyCoFVsOfType</span></a></span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Core.TyCo.Rep.html#TyVarTy"><span class="hs-identifier hs-type">TyVarTy</span></a></span><span> </span><span id="local-6989586621680848023"><span class="annot"><span class="annottext">TyCoVar
</span><a href="#local-6989586621680848023"><span class="hs-identifier hs-var">v</span></a></span></span><span class="hs-special">)</span><span>        </span><span id="local-6989586621680848022"><span class="annot"><span class="annottext">InterestingVarFun
</span><a href="#local-6989586621680848022"><span class="hs-identifier hs-var">f</span></a></span></span><span> </span><span id="local-6989586621680848021"><span class="annot"><span class="annottext">VarSet
</span><a href="#local-6989586621680848021"><span class="hs-identifier hs-var">bound_vars</span></a></span></span><span> </span><span class="hs-special">(</span><span id="local-6989586621680848020"><span class="annot"><span class="annottext">[TyCoVar]
</span><a href="#local-6989586621680848020"><span class="hs-identifier hs-var">acc_list</span></a></span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621680848019"><span class="annot"><span class="annottext">VarSet
</span><a href="#local-6989586621680848019"><span class="hs-identifier hs-var">acc_set</span></a></span></span><span class="hs-special">)</span><span>
</span><span id="line-568"></span><span>  </span><span class="hs-glyph">|</span><span> </span><span class="annot"><span class="annottext">Bool -&gt; Bool
</span><span class="hs-identifier hs-var">not</span></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">InterestingVarFun
</span><a href="#local-6989586621680848022"><span class="hs-identifier hs-var">f</span></a></span><span> </span><span class="annot"><span class="annottext">TyCoVar
</span><a href="#local-6989586621680848023"><span class="hs-identifier hs-var">v</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">[TyCoVar]
</span><a href="#local-6989586621680848020"><span class="hs-identifier hs-var">acc_list</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">VarSet
</span><a href="#local-6989586621680848019"><span class="hs-identifier hs-var">acc_set</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-569"></span><span>  </span><span class="hs-glyph">|</span><span> </span><span class="annot"><span class="annottext">TyCoVar
</span><a href="#local-6989586621680848023"><span class="hs-identifier hs-var">v</span></a></span><span> </span><span class="annot"><span class="annottext">TyCoVar -&gt; VarSet -&gt; Bool
</span><a href="GHC.Types.Var.Set.html#elemVarSet"><span class="hs-operator hs-var">`elemVarSet`</span></a></span><span> </span><span class="annot"><span class="annottext">VarSet
</span><a href="#local-6989586621680848021"><span class="hs-identifier hs-var">bound_vars</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">[TyCoVar]
</span><a href="#local-6989586621680848020"><span class="hs-identifier hs-var">acc_list</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">VarSet
</span><a href="#local-6989586621680848019"><span class="hs-identifier hs-var">acc_set</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-570"></span><span>  </span><span class="hs-glyph">|</span><span> </span><span class="annot"><span class="annottext">TyCoVar
</span><a href="#local-6989586621680848023"><span class="hs-identifier hs-var">v</span></a></span><span> </span><span class="annot"><span class="annottext">TyCoVar -&gt; VarSet -&gt; Bool
</span><a href="GHC.Types.Var.Set.html#elemVarSet"><span class="hs-operator hs-var">`elemVarSet`</span></a></span><span> </span><span class="annot"><span class="annottext">VarSet
</span><a href="#local-6989586621680848019"><span class="hs-identifier hs-var">acc_set</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">[TyCoVar]
</span><a href="#local-6989586621680848020"><span class="hs-identifier hs-var">acc_list</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">VarSet
</span><a href="#local-6989586621680848019"><span class="hs-identifier hs-var">acc_set</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-571"></span><span>  </span><span class="hs-glyph">|</span><span> </span><span class="annot"><span class="annottext">Bool
</span><a href="../../base/src/GHC.Base.html#otherwise"><span class="hs-identifier hs-var">otherwise</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Type -&gt; FV
</span><a href="GHC.Core.TyCo.FVs.html#tyCoFVsOfType"><span class="hs-identifier hs-var">tyCoFVsOfType</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">TyCoVar -&gt; Type
</span><a href="GHC.Types.Var.html#tyVarKind"><span class="hs-identifier hs-var">tyVarKind</span></a></span><span> </span><span class="annot"><span class="annottext">TyCoVar
</span><a href="#local-6989586621680848023"><span class="hs-identifier hs-var">v</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">InterestingVarFun
</span><a href="#local-6989586621680848022"><span class="hs-identifier hs-var">f</span></a></span><span>
</span><span id="line-572"></span><span>                               </span><span class="annot"><span class="annottext">VarSet
</span><a href="GHC.Types.Var.Set.html#emptyVarSet"><span class="hs-identifier hs-var">emptyVarSet</span></a></span><span>   </span><span class="hs-comment">-- See Note [Closing over free variable kinds]</span><span>
</span><span id="line-573"></span><span>                               </span><span class="hs-special">(</span><span class="annot"><span class="annottext">TyCoVar
</span><a href="#local-6989586621680848023"><span class="hs-identifier hs-var">v</span></a></span><span class="annot"><span class="annottext">TyCoVar -&gt; [TyCoVar] -&gt; [TyCoVar]
forall a. a -&gt; [a] -&gt; [a]
</span><span class="hs-glyph hs-var">:</span></span><span class="annot"><span class="annottext">[TyCoVar]
</span><a href="#local-6989586621680848020"><span class="hs-identifier hs-var">acc_list</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">VarSet -&gt; TyCoVar -&gt; VarSet
</span><a href="GHC.Types.Var.Set.html#extendVarSet"><span class="hs-identifier hs-var">extendVarSet</span></a></span><span> </span><span class="annot"><span class="annottext">VarSet
</span><a href="#local-6989586621680848019"><span class="hs-identifier hs-var">acc_set</span></a></span><span> </span><span class="annot"><span class="annottext">TyCoVar
</span><a href="#local-6989586621680848023"><span class="hs-identifier hs-var">v</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-574"></span><span class="annot"><a href="GHC.Core.TyCo.FVs.html#tyCoFVsOfType"><span class="hs-identifier hs-var">tyCoFVsOfType</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Core.TyCo.Rep.html#TyConApp"><span class="hs-identifier hs-type">TyConApp</span></a></span><span> </span><span class="annot"><span class="annottext">TyCon
</span><span class="hs-identifier">_</span></span><span> </span><span id="local-6989586621680848016"><span class="annot"><span class="annottext">[Type]
</span><a href="#local-6989586621680848016"><span class="hs-identifier hs-var">tys</span></a></span></span><span class="hs-special">)</span><span>   </span><span id="local-6989586621680848015"><span class="annot"><span class="annottext">InterestingVarFun
</span><a href="#local-6989586621680848015"><span class="hs-identifier hs-var">f</span></a></span></span><span> </span><span id="local-6989586621680848014"><span class="annot"><span class="annottext">VarSet
</span><a href="#local-6989586621680848014"><span class="hs-identifier hs-var">bound_vars</span></a></span></span><span> </span><span id="local-6989586621680848013"><span class="annot"><span class="annottext">([TyCoVar], VarSet)
</span><a href="#local-6989586621680848013"><span class="hs-identifier hs-var">acc</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">[Type] -&gt; FV
</span><a href="GHC.Core.TyCo.FVs.html#tyCoFVsOfTypes"><span class="hs-identifier hs-var">tyCoFVsOfTypes</span></a></span><span> </span><span class="annot"><span class="annottext">[Type]
</span><a href="#local-6989586621680848016"><span class="hs-identifier hs-var">tys</span></a></span><span> </span><span class="annot"><span class="annottext">InterestingVarFun
</span><a href="#local-6989586621680848015"><span class="hs-identifier hs-var">f</span></a></span><span> </span><span class="annot"><span class="annottext">VarSet
</span><a href="#local-6989586621680848014"><span class="hs-identifier hs-var">bound_vars</span></a></span><span> </span><span class="annot"><span class="annottext">([TyCoVar], VarSet)
</span><a href="#local-6989586621680848013"><span class="hs-identifier hs-var">acc</span></a></span><span>
</span><span id="line-575"></span><span class="annot"><a href="GHC.Core.TyCo.FVs.html#tyCoFVsOfType"><span class="hs-identifier hs-var">tyCoFVsOfType</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Core.TyCo.Rep.html#LitTy"><span class="hs-identifier hs-type">LitTy</span></a></span><span> </span><span class="hs-special">{</span><span class="hs-special">}</span><span class="hs-special">)</span><span>         </span><span id="local-6989586621680848011"><span class="annot"><span class="annottext">InterestingVarFun
</span><a href="#local-6989586621680848011"><span class="hs-identifier hs-var">f</span></a></span></span><span> </span><span id="local-6989586621680848010"><span class="annot"><span class="annottext">VarSet
</span><a href="#local-6989586621680848010"><span class="hs-identifier hs-var">bound_vars</span></a></span></span><span> </span><span id="local-6989586621680848009"><span class="annot"><span class="annottext">([TyCoVar], VarSet)
</span><a href="#local-6989586621680848009"><span class="hs-identifier hs-var">acc</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">FV
</span><a href="GHC.Utils.FV.html#emptyFV"><span class="hs-identifier hs-var">emptyFV</span></a></span><span> </span><span class="annot"><span class="annottext">InterestingVarFun
</span><a href="#local-6989586621680848011"><span class="hs-identifier hs-var">f</span></a></span><span> </span><span class="annot"><span class="annottext">VarSet
</span><a href="#local-6989586621680848010"><span class="hs-identifier hs-var">bound_vars</span></a></span><span> </span><span class="annot"><span class="annottext">([TyCoVar], VarSet)
</span><a href="#local-6989586621680848009"><span class="hs-identifier hs-var">acc</span></a></span><span>
</span><span id="line-576"></span><span class="annot"><a href="GHC.Core.TyCo.FVs.html#tyCoFVsOfType"><span class="hs-identifier hs-var">tyCoFVsOfType</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Core.TyCo.Rep.html#AppTy"><span class="hs-identifier hs-type">AppTy</span></a></span><span> </span><span id="local-6989586621680848006"><span class="annot"><span class="annottext">Type
</span><a href="#local-6989586621680848006"><span class="hs-identifier hs-var">fun</span></a></span></span><span> </span><span id="local-6989586621680848005"><span class="annot"><span class="annottext">Type
</span><a href="#local-6989586621680848005"><span class="hs-identifier hs-var">arg</span></a></span></span><span class="hs-special">)</span><span>    </span><span id="local-6989586621680848004"><span class="annot"><span class="annottext">InterestingVarFun
</span><a href="#local-6989586621680848004"><span class="hs-identifier hs-var">f</span></a></span></span><span> </span><span id="local-6989586621680848003"><span class="annot"><span class="annottext">VarSet
</span><a href="#local-6989586621680848003"><span class="hs-identifier hs-var">bound_vars</span></a></span></span><span> </span><span id="local-6989586621680848002"><span class="annot"><span class="annottext">([TyCoVar], VarSet)
</span><a href="#local-6989586621680848002"><span class="hs-identifier hs-var">acc</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Type -&gt; FV
</span><a href="GHC.Core.TyCo.FVs.html#tyCoFVsOfType"><span class="hs-identifier hs-var">tyCoFVsOfType</span></a></span><span> </span><span class="annot"><span class="annottext">Type
</span><a href="#local-6989586621680848006"><span class="hs-identifier hs-var">fun</span></a></span><span> </span><span class="annot"><span class="annottext">FV -&gt; FV -&gt; FV
</span><a href="GHC.Utils.FV.html#unionFV"><span class="hs-operator hs-var">`unionFV`</span></a></span><span> </span><span class="annot"><span class="annottext">Type -&gt; FV
</span><a href="GHC.Core.TyCo.FVs.html#tyCoFVsOfType"><span class="hs-identifier hs-var">tyCoFVsOfType</span></a></span><span> </span><span class="annot"><span class="annottext">Type
</span><a href="#local-6989586621680848005"><span class="hs-identifier hs-var">arg</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">InterestingVarFun
</span><a href="#local-6989586621680848004"><span class="hs-identifier hs-var">f</span></a></span><span> </span><span class="annot"><span class="annottext">VarSet
</span><a href="#local-6989586621680848003"><span class="hs-identifier hs-var">bound_vars</span></a></span><span> </span><span class="annot"><span class="annottext">([TyCoVar], VarSet)
</span><a href="#local-6989586621680848002"><span class="hs-identifier hs-var">acc</span></a></span><span>
</span><span id="line-577"></span><span class="annot"><a href="GHC.Core.TyCo.FVs.html#tyCoFVsOfType"><span class="hs-identifier hs-var">tyCoFVsOfType</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Core.TyCo.Rep.html#FunTy"><span class="hs-identifier hs-type">FunTy</span></a></span><span> </span><span class="annot"><span class="annottext">AnonArgFlag
</span><span class="hs-identifier">_</span></span><span> </span><span id="local-6989586621680848000"><span class="annot"><span class="annottext">Type
</span><a href="#local-6989586621680848000"><span class="hs-identifier hs-var">w</span></a></span></span><span> </span><span id="local-6989586621680847999"><span class="annot"><span class="annottext">Type
</span><a href="#local-6989586621680847999"><span class="hs-identifier hs-var">arg</span></a></span></span><span> </span><span id="local-6989586621680847998"><span class="annot"><span class="annottext">Type
</span><a href="#local-6989586621680847998"><span class="hs-identifier hs-var">res</span></a></span></span><span class="hs-special">)</span><span>  </span><span id="local-6989586621680847997"><span class="annot"><span class="annottext">InterestingVarFun
</span><a href="#local-6989586621680847997"><span class="hs-identifier hs-var">f</span></a></span></span><span> </span><span id="local-6989586621680847996"><span class="annot"><span class="annottext">VarSet
</span><a href="#local-6989586621680847996"><span class="hs-identifier hs-var">bound_vars</span></a></span></span><span> </span><span id="local-6989586621680847995"><span class="annot"><span class="annottext">([TyCoVar], VarSet)
</span><a href="#local-6989586621680847995"><span class="hs-identifier hs-var">acc</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Type -&gt; FV
</span><a href="GHC.Core.TyCo.FVs.html#tyCoFVsOfType"><span class="hs-identifier hs-var">tyCoFVsOfType</span></a></span><span> </span><span class="annot"><span class="annottext">Type
</span><a href="#local-6989586621680848000"><span class="hs-identifier hs-var">w</span></a></span><span> </span><span class="annot"><span class="annottext">FV -&gt; FV -&gt; FV
</span><a href="GHC.Utils.FV.html#unionFV"><span class="hs-operator hs-var">`unionFV`</span></a></span><span> </span><span class="annot"><span class="annottext">Type -&gt; FV
</span><a href="GHC.Core.TyCo.FVs.html#tyCoFVsOfType"><span class="hs-identifier hs-var">tyCoFVsOfType</span></a></span><span> </span><span class="annot"><span class="annottext">Type
</span><a href="#local-6989586621680847999"><span class="hs-identifier hs-var">arg</span></a></span><span> </span><span class="annot"><span class="annottext">FV -&gt; FV -&gt; FV
</span><a href="GHC.Utils.FV.html#unionFV"><span class="hs-operator hs-var">`unionFV`</span></a></span><span> </span><span class="annot"><span class="annottext">Type -&gt; FV
</span><a href="GHC.Core.TyCo.FVs.html#tyCoFVsOfType"><span class="hs-identifier hs-var">tyCoFVsOfType</span></a></span><span> </span><span class="annot"><span class="annottext">Type
</span><a href="#local-6989586621680847998"><span class="hs-identifier hs-var">res</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">InterestingVarFun
</span><a href="#local-6989586621680847997"><span class="hs-identifier hs-var">f</span></a></span><span> </span><span class="annot"><span class="annottext">VarSet
</span><a href="#local-6989586621680847996"><span class="hs-identifier hs-var">bound_vars</span></a></span><span> </span><span class="annot"><span class="annottext">([TyCoVar], VarSet)
</span><a href="#local-6989586621680847995"><span class="hs-identifier hs-var">acc</span></a></span><span>
</span><span id="line-578"></span><span class="annot"><a href="GHC.Core.TyCo.FVs.html#tyCoFVsOfType"><span class="hs-identifier hs-var">tyCoFVsOfType</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Core.TyCo.Rep.html#ForAllTy"><span class="hs-identifier hs-type">ForAllTy</span></a></span><span> </span><span id="local-6989586621680847993"><span class="annot"><span class="annottext">TyCoVarBinder
</span><a href="#local-6989586621680847993"><span class="hs-identifier hs-var">bndr</span></a></span></span><span> </span><span id="local-6989586621680847992"><span class="annot"><span class="annottext">Type
</span><a href="#local-6989586621680847992"><span class="hs-identifier hs-var">ty</span></a></span></span><span class="hs-special">)</span><span> </span><span id="local-6989586621680847991"><span class="annot"><span class="annottext">InterestingVarFun
</span><a href="#local-6989586621680847991"><span class="hs-identifier hs-var">f</span></a></span></span><span> </span><span id="local-6989586621680847990"><span class="annot"><span class="annottext">VarSet
</span><a href="#local-6989586621680847990"><span class="hs-identifier hs-var">bound_vars</span></a></span></span><span> </span><span id="local-6989586621680847989"><span class="annot"><span class="annottext">([TyCoVar], VarSet)
</span><a href="#local-6989586621680847989"><span class="hs-identifier hs-var">acc</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">TyCoVarBinder -&gt; FV -&gt; FV
</span><a href="GHC.Core.TyCo.FVs.html#tyCoFVsBndr"><span class="hs-identifier hs-var">tyCoFVsBndr</span></a></span><span> </span><span class="annot"><span class="annottext">TyCoVarBinder
</span><a href="#local-6989586621680847993"><span class="hs-identifier hs-var">bndr</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Type -&gt; FV
</span><a href="GHC.Core.TyCo.FVs.html#tyCoFVsOfType"><span class="hs-identifier hs-var">tyCoFVsOfType</span></a></span><span> </span><span class="annot"><span class="annottext">Type
</span><a href="#local-6989586621680847992"><span class="hs-identifier hs-var">ty</span></a></span><span class="hs-special">)</span><span>  </span><span class="annot"><span class="annottext">InterestingVarFun
</span><a href="#local-6989586621680847991"><span class="hs-identifier hs-var">f</span></a></span><span> </span><span class="annot"><span class="annottext">VarSet
</span><a href="#local-6989586621680847990"><span class="hs-identifier hs-var">bound_vars</span></a></span><span> </span><span class="annot"><span class="annottext">([TyCoVar], VarSet)
</span><a href="#local-6989586621680847989"><span class="hs-identifier hs-var">acc</span></a></span><span>
</span><span id="line-579"></span><span class="annot"><a href="GHC.Core.TyCo.FVs.html#tyCoFVsOfType"><span class="hs-identifier hs-var">tyCoFVsOfType</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Core.TyCo.Rep.html#CastTy"><span class="hs-identifier hs-type">CastTy</span></a></span><span> </span><span id="local-6989586621680847987"><span class="annot"><span class="annottext">Type
</span><a href="#local-6989586621680847987"><span class="hs-identifier hs-var">ty</span></a></span></span><span> </span><span id="local-6989586621680847986"><span class="annot"><span class="annottext">Coercion
</span><a href="#local-6989586621680847986"><span class="hs-identifier hs-var">co</span></a></span></span><span class="hs-special">)</span><span>     </span><span id="local-6989586621680847985"><span class="annot"><span class="annottext">InterestingVarFun
</span><a href="#local-6989586621680847985"><span class="hs-identifier hs-var">f</span></a></span></span><span> </span><span id="local-6989586621680847984"><span class="annot"><span class="annottext">VarSet
</span><a href="#local-6989586621680847984"><span class="hs-identifier hs-var">bound_vars</span></a></span></span><span> </span><span id="local-6989586621680847983"><span class="annot"><span class="annottext">([TyCoVar], VarSet)
</span><a href="#local-6989586621680847983"><span class="hs-identifier hs-var">acc</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Type -&gt; FV
</span><a href="GHC.Core.TyCo.FVs.html#tyCoFVsOfType"><span class="hs-identifier hs-var">tyCoFVsOfType</span></a></span><span> </span><span class="annot"><span class="annottext">Type
</span><a href="#local-6989586621680847987"><span class="hs-identifier hs-var">ty</span></a></span><span> </span><span class="annot"><span class="annottext">FV -&gt; FV -&gt; FV
</span><a href="GHC.Utils.FV.html#unionFV"><span class="hs-operator hs-var">`unionFV`</span></a></span><span> </span><span class="annot"><span class="annottext">Coercion -&gt; FV
</span><a href="GHC.Core.TyCo.FVs.html#tyCoFVsOfCo"><span class="hs-identifier hs-var">tyCoFVsOfCo</span></a></span><span> </span><span class="annot"><span class="annottext">Coercion
</span><a href="#local-6989586621680847986"><span class="hs-identifier hs-var">co</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">InterestingVarFun
</span><a href="#local-6989586621680847985"><span class="hs-identifier hs-var">f</span></a></span><span> </span><span class="annot"><span class="annottext">VarSet
</span><a href="#local-6989586621680847984"><span class="hs-identifier hs-var">bound_vars</span></a></span><span> </span><span class="annot"><span class="annottext">([TyCoVar], VarSet)
</span><a href="#local-6989586621680847983"><span class="hs-identifier hs-var">acc</span></a></span><span>
</span><span id="line-580"></span><span class="annot"><a href="GHC.Core.TyCo.FVs.html#tyCoFVsOfType"><span class="hs-identifier hs-var">tyCoFVsOfType</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Core.TyCo.Rep.html#CoercionTy"><span class="hs-identifier hs-type">CoercionTy</span></a></span><span> </span><span id="local-6989586621680847981"><span class="annot"><span class="annottext">Coercion
</span><a href="#local-6989586621680847981"><span class="hs-identifier hs-var">co</span></a></span></span><span class="hs-special">)</span><span>    </span><span id="local-6989586621680847980"><span class="annot"><span class="annottext">InterestingVarFun
</span><a href="#local-6989586621680847980"><span class="hs-identifier hs-var">f</span></a></span></span><span> </span><span id="local-6989586621680847979"><span class="annot"><span class="annottext">VarSet
</span><a href="#local-6989586621680847979"><span class="hs-identifier hs-var">bound_vars</span></a></span></span><span> </span><span id="local-6989586621680847978"><span class="annot"><span class="annottext">([TyCoVar], VarSet)
</span><a href="#local-6989586621680847978"><span class="hs-identifier hs-var">acc</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Coercion -&gt; FV
</span><a href="GHC.Core.TyCo.FVs.html#tyCoFVsOfCo"><span class="hs-identifier hs-var">tyCoFVsOfCo</span></a></span><span> </span><span class="annot"><span class="annottext">Coercion
</span><a href="#local-6989586621680847981"><span class="hs-identifier hs-var">co</span></a></span><span> </span><span class="annot"><span class="annottext">InterestingVarFun
</span><a href="#local-6989586621680847980"><span class="hs-identifier hs-var">f</span></a></span><span> </span><span class="annot"><span class="annottext">VarSet
</span><a href="#local-6989586621680847979"><span class="hs-identifier hs-var">bound_vars</span></a></span><span> </span><span class="annot"><span class="annottext">([TyCoVar], VarSet)
</span><a href="#local-6989586621680847978"><span class="hs-identifier hs-var">acc</span></a></span><span>
</span><span id="line-581"></span><span>
</span><span id="line-582"></span><span class="annot"><a href="GHC.Core.TyCo.FVs.html#tyCoFVsBndr"><span class="hs-identifier hs-type">tyCoFVsBndr</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Types.Var.html#TyCoVarBinder"><span class="hs-identifier hs-type">TyCoVarBinder</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Utils.FV.html#FV"><span class="hs-identifier hs-type">FV</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Utils.FV.html#FV"><span class="hs-identifier hs-type">FV</span></a></span><span>
</span><span id="line-583"></span><span class="hs-comment">-- Free vars of (forall b. &lt;thing with fvs&gt;)</span><span>
</span><span id="line-584"></span><span id="tyCoFVsBndr"><span class="annot"><span class="annottext">tyCoFVsBndr :: TyCoVarBinder -&gt; FV -&gt; FV
</span><a href="GHC.Core.TyCo.FVs.html#tyCoFVsBndr"><span class="hs-identifier hs-var hs-var">tyCoFVsBndr</span></a></span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Types.Var.html#Bndr"><span class="hs-identifier hs-type">Bndr</span></a></span><span> </span><span id="local-6989586621680847976"><span class="annot"><span class="annottext">TyCoVar
</span><a href="#local-6989586621680847976"><span class="hs-identifier hs-var">tv</span></a></span></span><span> </span><span class="annot"><span class="annottext">ArgFlag
</span><span class="hs-identifier">_</span></span><span class="hs-special">)</span><span> </span><span id="local-6989586621680847975"><span class="annot"><span class="annottext">FV
</span><a href="#local-6989586621680847975"><span class="hs-identifier hs-var">fvs</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">TyCoVar -&gt; FV -&gt; FV
</span><a href="GHC.Core.TyCo.FVs.html#tyCoFVsVarBndr"><span class="hs-identifier hs-var">tyCoFVsVarBndr</span></a></span><span> </span><span class="annot"><span class="annottext">TyCoVar
</span><a href="#local-6989586621680847976"><span class="hs-identifier hs-var">tv</span></a></span><span> </span><span class="annot"><span class="annottext">FV
</span><a href="#local-6989586621680847975"><span class="hs-identifier hs-var">fvs</span></a></span><span>
</span><span id="line-585"></span><span>
</span><span id="line-586"></span><span class="annot"><a href="GHC.Core.TyCo.FVs.html#tyCoFVsVarBndrs"><span class="hs-identifier hs-type">tyCoFVsVarBndrs</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="hs-special">[</span><span class="annot"><a href="GHC.Types.Var.html#Var"><span class="hs-identifier hs-type">Var</span></a></span><span class="hs-special">]</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Utils.FV.html#FV"><span class="hs-identifier hs-type">FV</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Utils.FV.html#FV"><span class="hs-identifier hs-type">FV</span></a></span><span>
</span><span id="line-587"></span><span id="tyCoFVsVarBndrs"><span class="annot"><span class="annottext">tyCoFVsVarBndrs :: [TyCoVar] -&gt; FV -&gt; FV
</span><a href="GHC.Core.TyCo.FVs.html#tyCoFVsVarBndrs"><span class="hs-identifier hs-var hs-var">tyCoFVsVarBndrs</span></a></span></span><span> </span><span id="local-6989586621680847973"><span class="annot"><span class="annottext">[TyCoVar]
</span><a href="#local-6989586621680847973"><span class="hs-identifier hs-var">vars</span></a></span></span><span> </span><span id="local-6989586621680847972"><span class="annot"><span class="annottext">FV
</span><a href="#local-6989586621680847972"><span class="hs-identifier hs-var">fvs</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">(TyCoVar -&gt; FV -&gt; FV) -&gt; FV -&gt; [TyCoVar] -&gt; FV
forall (t :: * -&gt; *) a b.
Foldable t =&gt;
(a -&gt; b -&gt; b) -&gt; b -&gt; t a -&gt; b
</span><a href="../../base/src/Data.Foldable.html#foldr"><span class="hs-identifier hs-var">foldr</span></a></span><span> </span><span class="annot"><span class="annottext">TyCoVar -&gt; FV -&gt; FV
</span><a href="GHC.Core.TyCo.FVs.html#tyCoFVsVarBndr"><span class="hs-identifier hs-var">tyCoFVsVarBndr</span></a></span><span> </span><span class="annot"><span class="annottext">FV
</span><a href="#local-6989586621680847972"><span class="hs-identifier hs-var">fvs</span></a></span><span> </span><span class="annot"><span class="annottext">[TyCoVar]
</span><a href="#local-6989586621680847973"><span class="hs-identifier hs-var">vars</span></a></span><span>
</span><span id="line-588"></span><span>
</span><span id="line-589"></span><span class="annot"><a href="GHC.Core.TyCo.FVs.html#tyCoFVsVarBndr"><span class="hs-identifier hs-type">tyCoFVsVarBndr</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Types.Var.html#Var"><span class="hs-identifier hs-type">Var</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Utils.FV.html#FV"><span class="hs-identifier hs-type">FV</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Utils.FV.html#FV"><span class="hs-identifier hs-type">FV</span></a></span><span>
</span><span id="line-590"></span><span id="tyCoFVsVarBndr"><span class="annot"><span class="annottext">tyCoFVsVarBndr :: TyCoVar -&gt; FV -&gt; FV
</span><a href="GHC.Core.TyCo.FVs.html#tyCoFVsVarBndr"><span class="hs-identifier hs-var hs-var">tyCoFVsVarBndr</span></a></span></span><span> </span><span id="local-6989586621680847970"><span class="annot"><span class="annottext">TyCoVar
</span><a href="#local-6989586621680847970"><span class="hs-identifier hs-var">var</span></a></span></span><span> </span><span id="local-6989586621680847969"><span class="annot"><span class="annottext">FV
</span><a href="#local-6989586621680847969"><span class="hs-identifier hs-var">fvs</span></a></span></span><span>
</span><span id="line-591"></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Type -&gt; FV
</span><a href="GHC.Core.TyCo.FVs.html#tyCoFVsOfType"><span class="hs-identifier hs-var">tyCoFVsOfType</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">TyCoVar -&gt; Type
</span><a href="GHC.Types.Var.html#varType"><span class="hs-identifier hs-var hs-var">varType</span></a></span><span> </span><span class="annot"><span class="annottext">TyCoVar
</span><a href="#local-6989586621680847970"><span class="hs-identifier hs-var">var</span></a></span><span class="hs-special">)</span><span>   </span><span class="hs-comment">-- Free vars of its type/kind</span><span>
</span><span id="line-592"></span><span>    </span><span class="annot"><span class="annottext">FV -&gt; FV -&gt; FV
</span><a href="GHC.Utils.FV.html#unionFV"><span class="hs-operator hs-var">`unionFV`</span></a></span><span> </span><span class="annot"><span class="annottext">TyCoVar -&gt; FV -&gt; FV
</span><a href="GHC.Utils.FV.html#delFV"><span class="hs-identifier hs-var">delFV</span></a></span><span> </span><span class="annot"><span class="annottext">TyCoVar
</span><a href="#local-6989586621680847970"><span class="hs-identifier hs-var">var</span></a></span><span> </span><span class="annot"><span class="annottext">FV
</span><a href="#local-6989586621680847969"><span class="hs-identifier hs-var">fvs</span></a></span><span>       </span><span class="hs-comment">-- Delete it from the thing-inside</span><span>
</span><span id="line-593"></span><span>
</span><span id="line-594"></span><span class="annot"><a href="GHC.Core.TyCo.FVs.html#tyCoFVsOfTypes"><span class="hs-identifier hs-type">tyCoFVsOfTypes</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="hs-special">[</span><span class="annot"><a href="GHC.Core.TyCo.Rep.html#Type"><span class="hs-identifier hs-type">Type</span></a></span><span class="hs-special">]</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Utils.FV.html#FV"><span class="hs-identifier hs-type">FV</span></a></span><span>
</span><span id="line-595"></span><span class="hs-comment">-- See Note [Free variables of types]</span><span>
</span><span id="line-596"></span><span id="tyCoFVsOfTypes"><span class="annot"><span class="annottext">tyCoFVsOfTypes :: [Type] -&gt; FV
</span><a href="GHC.Core.TyCo.FVs.html#tyCoFVsOfTypes"><span class="hs-identifier hs-var hs-var">tyCoFVsOfTypes</span></a></span></span><span> </span><span class="hs-special">(</span><span id="local-6989586621680847967"><span class="annot"><span class="annottext">Type
</span><a href="#local-6989586621680847967"><span class="hs-identifier hs-var">ty</span></a></span></span><span class="annot"><span class="hs-glyph hs-type">:</span></span><span id="local-6989586621680847966"><span class="annot"><span class="annottext">[Type]
</span><a href="#local-6989586621680847966"><span class="hs-identifier hs-var">tys</span></a></span></span><span class="hs-special">)</span><span> </span><span id="local-6989586621680847965"><span class="annot"><span class="annottext">InterestingVarFun
</span><a href="#local-6989586621680847965"><span class="hs-identifier hs-var">fv_cand</span></a></span></span><span> </span><span id="local-6989586621680847964"><span class="annot"><span class="annottext">VarSet
</span><a href="#local-6989586621680847964"><span class="hs-identifier hs-var">in_scope</span></a></span></span><span> </span><span id="local-6989586621680847963"><span class="annot"><span class="annottext">([TyCoVar], VarSet)
</span><a href="#local-6989586621680847963"><span class="hs-identifier hs-var">acc</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Type -&gt; FV
</span><a href="GHC.Core.TyCo.FVs.html#tyCoFVsOfType"><span class="hs-identifier hs-var">tyCoFVsOfType</span></a></span><span> </span><span class="annot"><span class="annottext">Type
</span><a href="#local-6989586621680847967"><span class="hs-identifier hs-var">ty</span></a></span><span> </span><span class="annot"><span class="annottext">FV -&gt; FV -&gt; FV
</span><a href="GHC.Utils.FV.html#unionFV"><span class="hs-operator hs-var">`unionFV`</span></a></span><span> </span><span class="annot"><span class="annottext">[Type] -&gt; FV
</span><a href="GHC.Core.TyCo.FVs.html#tyCoFVsOfTypes"><span class="hs-identifier hs-var">tyCoFVsOfTypes</span></a></span><span> </span><span class="annot"><span class="annottext">[Type]
</span><a href="#local-6989586621680847966"><span class="hs-identifier hs-var">tys</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">InterestingVarFun
</span><a href="#local-6989586621680847965"><span class="hs-identifier hs-var">fv_cand</span></a></span><span> </span><span class="annot"><span class="annottext">VarSet
</span><a href="#local-6989586621680847964"><span class="hs-identifier hs-var">in_scope</span></a></span><span> </span><span class="annot"><span class="annottext">([TyCoVar], VarSet)
</span><a href="#local-6989586621680847963"><span class="hs-identifier hs-var">acc</span></a></span><span>
</span><span id="line-597"></span><span class="annot"><a href="GHC.Core.TyCo.FVs.html#tyCoFVsOfTypes"><span class="hs-identifier hs-var">tyCoFVsOfTypes</span></a></span><span> </span><span class="hs-special">[</span><span class="hs-special">]</span><span>       </span><span id="local-6989586621680847962"><span class="annot"><span class="annottext">InterestingVarFun
</span><a href="#local-6989586621680847962"><span class="hs-identifier hs-var">fv_cand</span></a></span></span><span> </span><span id="local-6989586621680847961"><span class="annot"><span class="annottext">VarSet
</span><a href="#local-6989586621680847961"><span class="hs-identifier hs-var">in_scope</span></a></span></span><span> </span><span id="local-6989586621680847960"><span class="annot"><span class="annottext">([TyCoVar], VarSet)
</span><a href="#local-6989586621680847960"><span class="hs-identifier hs-var">acc</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">FV
</span><a href="GHC.Utils.FV.html#emptyFV"><span class="hs-identifier hs-var">emptyFV</span></a></span><span> </span><span class="annot"><span class="annottext">InterestingVarFun
</span><a href="#local-6989586621680847962"><span class="hs-identifier hs-var">fv_cand</span></a></span><span> </span><span class="annot"><span class="annottext">VarSet
</span><a href="#local-6989586621680847961"><span class="hs-identifier hs-var">in_scope</span></a></span><span> </span><span class="annot"><span class="annottext">([TyCoVar], VarSet)
</span><a href="#local-6989586621680847960"><span class="hs-identifier hs-var">acc</span></a></span><span>
</span><span id="line-598"></span><span>
</span><span id="line-599"></span><span class="hs-comment">-- | Get a deterministic set of the vars free in a coercion</span><span>
</span><span id="line-600"></span><span class="annot"><a href="GHC.Core.TyCo.FVs.html#tyCoVarsOfCoDSet"><span class="hs-identifier hs-type">tyCoVarsOfCoDSet</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Core.TyCo.Rep.html#Coercion"><span class="hs-identifier hs-type">Coercion</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Types.Var.Set.html#DTyCoVarSet"><span class="hs-identifier hs-type">DTyCoVarSet</span></a></span><span>
</span><span id="line-601"></span><span class="hs-comment">-- See Note [Free variables of types]</span><span>
</span><span id="line-602"></span><span id="tyCoVarsOfCoDSet"><span class="annot"><span class="annottext">tyCoVarsOfCoDSet :: Coercion -&gt; DTyVarSet
</span><a href="GHC.Core.TyCo.FVs.html#tyCoVarsOfCoDSet"><span class="hs-identifier hs-var hs-var">tyCoVarsOfCoDSet</span></a></span></span><span> </span><span id="local-6989586621680847959"><span class="annot"><span class="annottext">Coercion
</span><a href="#local-6989586621680847959"><span class="hs-identifier hs-var">co</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">FV -&gt; DTyVarSet
</span><a href="GHC.Utils.FV.html#fvDVarSet"><span class="hs-identifier hs-var">fvDVarSet</span></a></span><span> </span><span class="annot"><span class="annottext">(FV -&gt; DTyVarSet) -&gt; FV -&gt; DTyVarSet
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="annot"><span class="annottext">Coercion -&gt; FV
</span><a href="GHC.Core.TyCo.FVs.html#tyCoFVsOfCo"><span class="hs-identifier hs-var">tyCoFVsOfCo</span></a></span><span> </span><span class="annot"><span class="annottext">Coercion
</span><a href="#local-6989586621680847959"><span class="hs-identifier hs-var">co</span></a></span><span>
</span><span id="line-603"></span><span>
</span><span id="line-604"></span><span class="annot"><a href="GHC.Core.TyCo.FVs.html#tyCoVarsOfCoList"><span class="hs-identifier hs-type">tyCoVarsOfCoList</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Core.TyCo.Rep.html#Coercion"><span class="hs-identifier hs-type">Coercion</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">[</span><span class="annot"><a href="GHC.Types.Var.html#TyCoVar"><span class="hs-identifier hs-type">TyCoVar</span></a></span><span class="hs-special">]</span><span>
</span><span id="line-605"></span><span class="hs-comment">-- See Note [Free variables of types]</span><span>
</span><span id="line-606"></span><span id="tyCoVarsOfCoList"><span class="annot"><span class="annottext">tyCoVarsOfCoList :: Coercion -&gt; [TyCoVar]
</span><a href="GHC.Core.TyCo.FVs.html#tyCoVarsOfCoList"><span class="hs-identifier hs-var hs-var">tyCoVarsOfCoList</span></a></span></span><span> </span><span id="local-6989586621680847958"><span class="annot"><span class="annottext">Coercion
</span><a href="#local-6989586621680847958"><span class="hs-identifier hs-var">co</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">FV -&gt; [TyCoVar]
</span><a href="GHC.Utils.FV.html#fvVarList"><span class="hs-identifier hs-var">fvVarList</span></a></span><span> </span><span class="annot"><span class="annottext">(FV -&gt; [TyCoVar]) -&gt; FV -&gt; [TyCoVar]
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="annot"><span class="annottext">Coercion -&gt; FV
</span><a href="GHC.Core.TyCo.FVs.html#tyCoFVsOfCo"><span class="hs-identifier hs-var">tyCoFVsOfCo</span></a></span><span> </span><span class="annot"><span class="annottext">Coercion
</span><a href="#local-6989586621680847958"><span class="hs-identifier hs-var">co</span></a></span><span>
</span><span id="line-607"></span><span>
</span><span id="line-608"></span><span class="annot"><a href="GHC.Core.TyCo.FVs.html#tyCoFVsOfMCo"><span class="hs-identifier hs-type">tyCoFVsOfMCo</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Core.TyCo.Rep.html#MCoercion"><span class="hs-identifier hs-type">MCoercion</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Utils.FV.html#FV"><span class="hs-identifier hs-type">FV</span></a></span><span>
</span><span id="line-609"></span><span id="tyCoFVsOfMCo"><span class="annot"><span class="annottext">tyCoFVsOfMCo :: MCoercion -&gt; FV
</span><a href="GHC.Core.TyCo.FVs.html#tyCoFVsOfMCo"><span class="hs-identifier hs-var hs-var">tyCoFVsOfMCo</span></a></span></span><span> </span><span class="annot"><span class="annottext">MCoercion
</span><a href="GHC.Core.TyCo.Rep.html#MRefl"><span class="hs-identifier hs-var">MRefl</span></a></span><span>    </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">FV
</span><a href="GHC.Utils.FV.html#emptyFV"><span class="hs-identifier hs-var">emptyFV</span></a></span><span>
</span><span id="line-610"></span><span class="annot"><a href="GHC.Core.TyCo.FVs.html#tyCoFVsOfMCo"><span class="hs-identifier hs-var">tyCoFVsOfMCo</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Core.TyCo.Rep.html#MCo"><span class="hs-identifier hs-type">MCo</span></a></span><span> </span><span id="local-6989586621680847956"><span class="annot"><span class="annottext">Coercion
</span><a href="#local-6989586621680847956"><span class="hs-identifier hs-var">co</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Coercion -&gt; FV
</span><a href="GHC.Core.TyCo.FVs.html#tyCoFVsOfCo"><span class="hs-identifier hs-var">tyCoFVsOfCo</span></a></span><span> </span><span class="annot"><span class="annottext">Coercion
</span><a href="#local-6989586621680847956"><span class="hs-identifier hs-var">co</span></a></span><span>
</span><span id="line-611"></span><span>
</span><span id="line-612"></span><span class="annot"><a href="GHC.Core.TyCo.FVs.html#tyCoFVsOfCo"><span class="hs-identifier hs-type">tyCoFVsOfCo</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Core.TyCo.Rep.html#Coercion"><span class="hs-identifier hs-type">Coercion</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Utils.FV.html#FV"><span class="hs-identifier hs-type">FV</span></a></span><span>
</span><span id="line-613"></span><span class="hs-comment">-- Extracts type and coercion variables from a coercion</span><span>
</span><span id="line-614"></span><span class="hs-comment">-- See Note [Free variables of types]</span><span>
</span><span id="line-615"></span><span id="tyCoFVsOfCo"><span class="annot"><span class="annottext">tyCoFVsOfCo :: Coercion -&gt; FV
</span><a href="GHC.Core.TyCo.FVs.html#tyCoFVsOfCo"><span class="hs-identifier hs-var hs-var">tyCoFVsOfCo</span></a></span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Core.TyCo.Rep.html#Refl"><span class="hs-identifier hs-type">Refl</span></a></span><span> </span><span id="local-6989586621680847954"><span class="annot"><span class="annottext">Type
</span><a href="#local-6989586621680847954"><span class="hs-identifier hs-var">ty</span></a></span></span><span class="hs-special">)</span><span> </span><span id="local-6989586621680847953"><span class="annot"><span class="annottext">InterestingVarFun
</span><a href="#local-6989586621680847953"><span class="hs-identifier hs-var">fv_cand</span></a></span></span><span> </span><span id="local-6989586621680847952"><span class="annot"><span class="annottext">VarSet
</span><a href="#local-6989586621680847952"><span class="hs-identifier hs-var">in_scope</span></a></span></span><span> </span><span id="local-6989586621680847951"><span class="annot"><span class="annottext">([TyCoVar], VarSet)
</span><a href="#local-6989586621680847951"><span class="hs-identifier hs-var">acc</span></a></span></span><span>
</span><span id="line-616"></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Type -&gt; FV
</span><a href="GHC.Core.TyCo.FVs.html#tyCoFVsOfType"><span class="hs-identifier hs-var">tyCoFVsOfType</span></a></span><span> </span><span class="annot"><span class="annottext">Type
</span><a href="#local-6989586621680847954"><span class="hs-identifier hs-var">ty</span></a></span><span> </span><span class="annot"><span class="annottext">InterestingVarFun
</span><a href="#local-6989586621680847953"><span class="hs-identifier hs-var">fv_cand</span></a></span><span> </span><span class="annot"><span class="annottext">VarSet
</span><a href="#local-6989586621680847952"><span class="hs-identifier hs-var">in_scope</span></a></span><span> </span><span class="annot"><span class="annottext">([TyCoVar], VarSet)
</span><a href="#local-6989586621680847951"><span class="hs-identifier hs-var">acc</span></a></span><span>
</span><span id="line-617"></span><span class="annot"><a href="GHC.Core.TyCo.FVs.html#tyCoFVsOfCo"><span class="hs-identifier hs-var">tyCoFVsOfCo</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Core.TyCo.Rep.html#GRefl"><span class="hs-identifier hs-type">GRefl</span></a></span><span> </span><span class="annot"><span class="annottext">Role
</span><span class="hs-identifier">_</span></span><span> </span><span id="local-6989586621680847949"><span class="annot"><span class="annottext">Type
</span><a href="#local-6989586621680847949"><span class="hs-identifier hs-var">ty</span></a></span></span><span> </span><span id="local-6989586621680847948"><span class="annot"><span class="annottext">MCoercion
</span><a href="#local-6989586621680847948"><span class="hs-identifier hs-var">mco</span></a></span></span><span class="hs-special">)</span><span> </span><span id="local-6989586621680847947"><span class="annot"><span class="annottext">InterestingVarFun
</span><a href="#local-6989586621680847947"><span class="hs-identifier hs-var">fv_cand</span></a></span></span><span> </span><span id="local-6989586621680847946"><span class="annot"><span class="annottext">VarSet
</span><a href="#local-6989586621680847946"><span class="hs-identifier hs-var">in_scope</span></a></span></span><span> </span><span id="local-6989586621680847945"><span class="annot"><span class="annottext">([TyCoVar], VarSet)
</span><a href="#local-6989586621680847945"><span class="hs-identifier hs-var">acc</span></a></span></span><span>
</span><span id="line-618"></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Type -&gt; FV
</span><a href="GHC.Core.TyCo.FVs.html#tyCoFVsOfType"><span class="hs-identifier hs-var">tyCoFVsOfType</span></a></span><span> </span><span class="annot"><span class="annottext">Type
</span><a href="#local-6989586621680847949"><span class="hs-identifier hs-var">ty</span></a></span><span> </span><span class="annot"><span class="annottext">FV -&gt; FV -&gt; FV
</span><a href="GHC.Utils.FV.html#unionFV"><span class="hs-operator hs-var">`unionFV`</span></a></span><span> </span><span class="annot"><span class="annottext">MCoercion -&gt; FV
</span><a href="GHC.Core.TyCo.FVs.html#tyCoFVsOfMCo"><span class="hs-identifier hs-var">tyCoFVsOfMCo</span></a></span><span> </span><span class="annot"><span class="annottext">MCoercion
</span><a href="#local-6989586621680847948"><span class="hs-identifier hs-var">mco</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">InterestingVarFun
</span><a href="#local-6989586621680847947"><span class="hs-identifier hs-var">fv_cand</span></a></span><span> </span><span class="annot"><span class="annottext">VarSet
</span><a href="#local-6989586621680847946"><span class="hs-identifier hs-var">in_scope</span></a></span><span> </span><span class="annot"><span class="annottext">([TyCoVar], VarSet)
</span><a href="#local-6989586621680847945"><span class="hs-identifier hs-var">acc</span></a></span><span>
</span><span id="line-619"></span><span class="annot"><a href="GHC.Core.TyCo.FVs.html#tyCoFVsOfCo"><span class="hs-identifier hs-var">tyCoFVsOfCo</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Core.TyCo.Rep.html#TyConAppCo"><span class="hs-identifier hs-type">TyConAppCo</span></a></span><span> </span><span class="annot"><span class="annottext">Role
</span><span class="hs-identifier">_</span></span><span> </span><span class="annot"><span class="annottext">TyCon
</span><span class="hs-identifier">_</span></span><span> </span><span id="local-6989586621680847943"><span class="annot"><span class="annottext">[Coercion]
</span><a href="#local-6989586621680847943"><span class="hs-identifier hs-var">cos</span></a></span></span><span class="hs-special">)</span><span> </span><span id="local-6989586621680847942"><span class="annot"><span class="annottext">InterestingVarFun
</span><a href="#local-6989586621680847942"><span class="hs-identifier hs-var">fv_cand</span></a></span></span><span> </span><span id="local-6989586621680847941"><span class="annot"><span class="annottext">VarSet
</span><a href="#local-6989586621680847941"><span class="hs-identifier hs-var">in_scope</span></a></span></span><span> </span><span id="local-6989586621680847940"><span class="annot"><span class="annottext">([TyCoVar], VarSet)
</span><a href="#local-6989586621680847940"><span class="hs-identifier hs-var">acc</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">[Coercion] -&gt; FV
</span><a href="GHC.Core.TyCo.FVs.html#tyCoFVsOfCos"><span class="hs-identifier hs-var">tyCoFVsOfCos</span></a></span><span> </span><span class="annot"><span class="annottext">[Coercion]
</span><a href="#local-6989586621680847943"><span class="hs-identifier hs-var">cos</span></a></span><span> </span><span class="annot"><span class="annottext">InterestingVarFun
</span><a href="#local-6989586621680847942"><span class="hs-identifier hs-var">fv_cand</span></a></span><span> </span><span class="annot"><span class="annottext">VarSet
</span><a href="#local-6989586621680847941"><span class="hs-identifier hs-var">in_scope</span></a></span><span> </span><span class="annot"><span class="annottext">([TyCoVar], VarSet)
</span><a href="#local-6989586621680847940"><span class="hs-identifier hs-var">acc</span></a></span><span>
</span><span id="line-620"></span><span class="annot"><a href="GHC.Core.TyCo.FVs.html#tyCoFVsOfCo"><span class="hs-identifier hs-var">tyCoFVsOfCo</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Core.TyCo.Rep.html#AppCo"><span class="hs-identifier hs-type">AppCo</span></a></span><span> </span><span id="local-6989586621680847938"><span class="annot"><span class="annottext">Coercion
</span><a href="#local-6989586621680847938"><span class="hs-identifier hs-var">co</span></a></span></span><span> </span><span id="local-6989586621680847937"><span class="annot"><span class="annottext">Coercion
</span><a href="#local-6989586621680847937"><span class="hs-identifier hs-var">arg</span></a></span></span><span class="hs-special">)</span><span> </span><span id="local-6989586621680847936"><span class="annot"><span class="annottext">InterestingVarFun
</span><a href="#local-6989586621680847936"><span class="hs-identifier hs-var">fv_cand</span></a></span></span><span> </span><span id="local-6989586621680847935"><span class="annot"><span class="annottext">VarSet
</span><a href="#local-6989586621680847935"><span class="hs-identifier hs-var">in_scope</span></a></span></span><span> </span><span id="local-6989586621680847934"><span class="annot"><span class="annottext">([TyCoVar], VarSet)
</span><a href="#local-6989586621680847934"><span class="hs-identifier hs-var">acc</span></a></span></span><span>
</span><span id="line-621"></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Coercion -&gt; FV
</span><a href="GHC.Core.TyCo.FVs.html#tyCoFVsOfCo"><span class="hs-identifier hs-var">tyCoFVsOfCo</span></a></span><span> </span><span class="annot"><span class="annottext">Coercion
</span><a href="#local-6989586621680847938"><span class="hs-identifier hs-var">co</span></a></span><span> </span><span class="annot"><span class="annottext">FV -&gt; FV -&gt; FV
</span><a href="GHC.Utils.FV.html#unionFV"><span class="hs-operator hs-var">`unionFV`</span></a></span><span> </span><span class="annot"><span class="annottext">Coercion -&gt; FV
</span><a href="GHC.Core.TyCo.FVs.html#tyCoFVsOfCo"><span class="hs-identifier hs-var">tyCoFVsOfCo</span></a></span><span> </span><span class="annot"><span class="annottext">Coercion
</span><a href="#local-6989586621680847937"><span class="hs-identifier hs-var">arg</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">InterestingVarFun
</span><a href="#local-6989586621680847936"><span class="hs-identifier hs-var">fv_cand</span></a></span><span> </span><span class="annot"><span class="annottext">VarSet
</span><a href="#local-6989586621680847935"><span class="hs-identifier hs-var">in_scope</span></a></span><span> </span><span class="annot"><span class="annottext">([TyCoVar], VarSet)
</span><a href="#local-6989586621680847934"><span class="hs-identifier hs-var">acc</span></a></span><span>
</span><span id="line-622"></span><span class="annot"><a href="GHC.Core.TyCo.FVs.html#tyCoFVsOfCo"><span class="hs-identifier hs-var">tyCoFVsOfCo</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Core.TyCo.Rep.html#ForAllCo"><span class="hs-identifier hs-type">ForAllCo</span></a></span><span> </span><span id="local-6989586621680847932"><span class="annot"><span class="annottext">TyCoVar
</span><a href="#local-6989586621680847932"><span class="hs-identifier hs-var">tv</span></a></span></span><span> </span><span id="local-6989586621680847931"><span class="annot"><span class="annottext">Coercion
</span><a href="#local-6989586621680847931"><span class="hs-identifier hs-var">kind_co</span></a></span></span><span> </span><span id="local-6989586621680847930"><span class="annot"><span class="annottext">Coercion
</span><a href="#local-6989586621680847930"><span class="hs-identifier hs-var">co</span></a></span></span><span class="hs-special">)</span><span> </span><span id="local-6989586621680847929"><span class="annot"><span class="annottext">InterestingVarFun
</span><a href="#local-6989586621680847929"><span class="hs-identifier hs-var">fv_cand</span></a></span></span><span> </span><span id="local-6989586621680847928"><span class="annot"><span class="annottext">VarSet
</span><a href="#local-6989586621680847928"><span class="hs-identifier hs-var">in_scope</span></a></span></span><span> </span><span id="local-6989586621680847927"><span class="annot"><span class="annottext">([TyCoVar], VarSet)
</span><a href="#local-6989586621680847927"><span class="hs-identifier hs-var">acc</span></a></span></span><span>
</span><span id="line-623"></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">TyCoVar -&gt; FV -&gt; FV
</span><a href="GHC.Core.TyCo.FVs.html#tyCoFVsVarBndr"><span class="hs-identifier hs-var">tyCoFVsVarBndr</span></a></span><span> </span><span class="annot"><span class="annottext">TyCoVar
</span><a href="#local-6989586621680847932"><span class="hs-identifier hs-var">tv</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Coercion -&gt; FV
</span><a href="GHC.Core.TyCo.FVs.html#tyCoFVsOfCo"><span class="hs-identifier hs-var">tyCoFVsOfCo</span></a></span><span> </span><span class="annot"><span class="annottext">Coercion
</span><a href="#local-6989586621680847930"><span class="hs-identifier hs-var">co</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">FV -&gt; FV -&gt; FV
</span><a href="GHC.Utils.FV.html#unionFV"><span class="hs-operator hs-var">`unionFV`</span></a></span><span> </span><span class="annot"><span class="annottext">Coercion -&gt; FV
</span><a href="GHC.Core.TyCo.FVs.html#tyCoFVsOfCo"><span class="hs-identifier hs-var">tyCoFVsOfCo</span></a></span><span> </span><span class="annot"><span class="annottext">Coercion
</span><a href="#local-6989586621680847931"><span class="hs-identifier hs-var">kind_co</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">InterestingVarFun
</span><a href="#local-6989586621680847929"><span class="hs-identifier hs-var">fv_cand</span></a></span><span> </span><span class="annot"><span class="annottext">VarSet
</span><a href="#local-6989586621680847928"><span class="hs-identifier hs-var">in_scope</span></a></span><span> </span><span class="annot"><span class="annottext">([TyCoVar], VarSet)
</span><a href="#local-6989586621680847927"><span class="hs-identifier hs-var">acc</span></a></span><span>
</span><span id="line-624"></span><span class="annot"><a href="GHC.Core.TyCo.FVs.html#tyCoFVsOfCo"><span class="hs-identifier hs-var">tyCoFVsOfCo</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Core.TyCo.Rep.html#FunCo"><span class="hs-identifier hs-type">FunCo</span></a></span><span> </span><span class="annot"><span class="annottext">Role
</span><span class="hs-identifier">_</span></span><span> </span><span id="local-6989586621680847925"><span class="annot"><span class="annottext">Coercion
</span><a href="#local-6989586621680847925"><span class="hs-identifier hs-var">w</span></a></span></span><span> </span><span id="local-6989586621680847924"><span class="annot"><span class="annottext">Coercion
</span><a href="#local-6989586621680847924"><span class="hs-identifier hs-var">co1</span></a></span></span><span> </span><span id="local-6989586621680847923"><span class="annot"><span class="annottext">Coercion
</span><a href="#local-6989586621680847923"><span class="hs-identifier hs-var">co2</span></a></span></span><span class="hs-special">)</span><span>    </span><span id="local-6989586621680847922"><span class="annot"><span class="annottext">InterestingVarFun
</span><a href="#local-6989586621680847922"><span class="hs-identifier hs-var">fv_cand</span></a></span></span><span> </span><span id="local-6989586621680847921"><span class="annot"><span class="annottext">VarSet
</span><a href="#local-6989586621680847921"><span class="hs-identifier hs-var">in_scope</span></a></span></span><span> </span><span id="local-6989586621680847920"><span class="annot"><span class="annottext">([TyCoVar], VarSet)
</span><a href="#local-6989586621680847920"><span class="hs-identifier hs-var">acc</span></a></span></span><span>
</span><span id="line-625"></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Coercion -&gt; FV
</span><a href="GHC.Core.TyCo.FVs.html#tyCoFVsOfCo"><span class="hs-identifier hs-var">tyCoFVsOfCo</span></a></span><span> </span><span class="annot"><span class="annottext">Coercion
</span><a href="#local-6989586621680847924"><span class="hs-identifier hs-var">co1</span></a></span><span> </span><span class="annot"><span class="annottext">FV -&gt; FV -&gt; FV
</span><a href="GHC.Utils.FV.html#unionFV"><span class="hs-operator hs-var">`unionFV`</span></a></span><span> </span><span class="annot"><span class="annottext">Coercion -&gt; FV
</span><a href="GHC.Core.TyCo.FVs.html#tyCoFVsOfCo"><span class="hs-identifier hs-var">tyCoFVsOfCo</span></a></span><span> </span><span class="annot"><span class="annottext">Coercion
</span><a href="#local-6989586621680847923"><span class="hs-identifier hs-var">co2</span></a></span><span> </span><span class="annot"><span class="annottext">FV -&gt; FV -&gt; FV
</span><a href="GHC.Utils.FV.html#unionFV"><span class="hs-operator hs-var">`unionFV`</span></a></span><span> </span><span class="annot"><span class="annottext">Coercion -&gt; FV
</span><a href="GHC.Core.TyCo.FVs.html#tyCoFVsOfCo"><span class="hs-identifier hs-var">tyCoFVsOfCo</span></a></span><span> </span><span class="annot"><span class="annottext">Coercion
</span><a href="#local-6989586621680847925"><span class="hs-identifier hs-var">w</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">InterestingVarFun
</span><a href="#local-6989586621680847922"><span class="hs-identifier hs-var">fv_cand</span></a></span><span> </span><span class="annot"><span class="annottext">VarSet
</span><a href="#local-6989586621680847921"><span class="hs-identifier hs-var">in_scope</span></a></span><span> </span><span class="annot"><span class="annottext">([TyCoVar], VarSet)
</span><a href="#local-6989586621680847920"><span class="hs-identifier hs-var">acc</span></a></span><span>
</span><span id="line-626"></span><span class="annot"><a href="GHC.Core.TyCo.FVs.html#tyCoFVsOfCo"><span class="hs-identifier hs-var">tyCoFVsOfCo</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Core.TyCo.Rep.html#CoVarCo"><span class="hs-identifier hs-type">CoVarCo</span></a></span><span> </span><span id="local-6989586621680847918"><span class="annot"><span class="annottext">TyCoVar
</span><a href="#local-6989586621680847918"><span class="hs-identifier hs-var">v</span></a></span></span><span class="hs-special">)</span><span> </span><span id="local-6989586621680847917"><span class="annot"><span class="annottext">InterestingVarFun
</span><a href="#local-6989586621680847917"><span class="hs-identifier hs-var">fv_cand</span></a></span></span><span> </span><span id="local-6989586621680847916"><span class="annot"><span class="annottext">VarSet
</span><a href="#local-6989586621680847916"><span class="hs-identifier hs-var">in_scope</span></a></span></span><span> </span><span id="local-6989586621680847915"><span class="annot"><span class="annottext">([TyCoVar], VarSet)
</span><a href="#local-6989586621680847915"><span class="hs-identifier hs-var">acc</span></a></span></span><span>
</span><span id="line-627"></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">TyCoVar -&gt; FV
</span><a href="GHC.Core.TyCo.FVs.html#tyCoFVsOfCoVar"><span class="hs-identifier hs-var">tyCoFVsOfCoVar</span></a></span><span> </span><span class="annot"><span class="annottext">TyCoVar
</span><a href="#local-6989586621680847918"><span class="hs-identifier hs-var">v</span></a></span><span> </span><span class="annot"><span class="annottext">InterestingVarFun
</span><a href="#local-6989586621680847917"><span class="hs-identifier hs-var">fv_cand</span></a></span><span> </span><span class="annot"><span class="annottext">VarSet
</span><a href="#local-6989586621680847916"><span class="hs-identifier hs-var">in_scope</span></a></span><span> </span><span class="annot"><span class="annottext">([TyCoVar], VarSet)
</span><a href="#local-6989586621680847915"><span class="hs-identifier hs-var">acc</span></a></span><span>
</span><span id="line-628"></span><span class="annot"><a href="GHC.Core.TyCo.FVs.html#tyCoFVsOfCo"><span class="hs-identifier hs-var">tyCoFVsOfCo</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Core.TyCo.Rep.html#HoleCo"><span class="hs-identifier hs-type">HoleCo</span></a></span><span> </span><span id="local-6989586621680847912"><span class="annot"><span class="annottext">CoercionHole
</span><a href="#local-6989586621680847912"><span class="hs-identifier hs-var">h</span></a></span></span><span class="hs-special">)</span><span> </span><span id="local-6989586621680847911"><span class="annot"><span class="annottext">InterestingVarFun
</span><a href="#local-6989586621680847911"><span class="hs-identifier hs-var">fv_cand</span></a></span></span><span> </span><span id="local-6989586621680847910"><span class="annot"><span class="annottext">VarSet
</span><a href="#local-6989586621680847910"><span class="hs-identifier hs-var">in_scope</span></a></span></span><span> </span><span id="local-6989586621680847909"><span class="annot"><span class="annottext">([TyCoVar], VarSet)
</span><a href="#local-6989586621680847909"><span class="hs-identifier hs-var">acc</span></a></span></span><span>
</span><span id="line-629"></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">TyCoVar -&gt; FV
</span><a href="GHC.Core.TyCo.FVs.html#tyCoFVsOfCoVar"><span class="hs-identifier hs-var">tyCoFVsOfCoVar</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">CoercionHole -&gt; TyCoVar
</span><a href="GHC.Core.TyCo.Rep.html#coHoleCoVar"><span class="hs-identifier hs-var">coHoleCoVar</span></a></span><span> </span><span class="annot"><span class="annottext">CoercionHole
</span><a href="#local-6989586621680847912"><span class="hs-identifier hs-var">h</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">InterestingVarFun
</span><a href="#local-6989586621680847911"><span class="hs-identifier hs-var">fv_cand</span></a></span><span> </span><span class="annot"><span class="annottext">VarSet
</span><a href="#local-6989586621680847910"><span class="hs-identifier hs-var">in_scope</span></a></span><span> </span><span class="annot"><span class="annottext">([TyCoVar], VarSet)
</span><a href="#local-6989586621680847909"><span class="hs-identifier hs-var">acc</span></a></span><span>
</span><span id="line-630"></span><span>    </span><span class="hs-comment">-- See Note [CoercionHoles and coercion free variables]</span><span>
</span><span id="line-631"></span><span class="annot"><a href="GHC.Core.TyCo.FVs.html#tyCoFVsOfCo"><span class="hs-identifier hs-var">tyCoFVsOfCo</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Core.TyCo.Rep.html#AxiomInstCo"><span class="hs-identifier hs-type">AxiomInstCo</span></a></span><span> </span><span class="annot"><span class="annottext">CoAxiom Branched
</span><span class="hs-identifier">_</span></span><span> </span><span class="annot"><span class="annottext">BranchIndex
</span><span class="hs-identifier">_</span></span><span> </span><span id="local-6989586621680847907"><span class="annot"><span class="annottext">[Coercion]
</span><a href="#local-6989586621680847907"><span class="hs-identifier hs-var">cos</span></a></span></span><span class="hs-special">)</span><span> </span><span id="local-6989586621680847906"><span class="annot"><span class="annottext">InterestingVarFun
</span><a href="#local-6989586621680847906"><span class="hs-identifier hs-var">fv_cand</span></a></span></span><span> </span><span id="local-6989586621680847905"><span class="annot"><span class="annottext">VarSet
</span><a href="#local-6989586621680847905"><span class="hs-identifier hs-var">in_scope</span></a></span></span><span> </span><span id="local-6989586621680847904"><span class="annot"><span class="annottext">([TyCoVar], VarSet)
</span><a href="#local-6989586621680847904"><span class="hs-identifier hs-var">acc</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">[Coercion] -&gt; FV
</span><a href="GHC.Core.TyCo.FVs.html#tyCoFVsOfCos"><span class="hs-identifier hs-var">tyCoFVsOfCos</span></a></span><span> </span><span class="annot"><span class="annottext">[Coercion]
</span><a href="#local-6989586621680847907"><span class="hs-identifier hs-var">cos</span></a></span><span> </span><span class="annot"><span class="annottext">InterestingVarFun
</span><a href="#local-6989586621680847906"><span class="hs-identifier hs-var">fv_cand</span></a></span><span> </span><span class="annot"><span class="annottext">VarSet
</span><a href="#local-6989586621680847905"><span class="hs-identifier hs-var">in_scope</span></a></span><span> </span><span class="annot"><span class="annottext">([TyCoVar], VarSet)
</span><a href="#local-6989586621680847904"><span class="hs-identifier hs-var">acc</span></a></span><span>
</span><span id="line-632"></span><span class="annot"><a href="GHC.Core.TyCo.FVs.html#tyCoFVsOfCo"><span class="hs-identifier hs-var">tyCoFVsOfCo</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Core.TyCo.Rep.html#UnivCo"><span class="hs-identifier hs-type">UnivCo</span></a></span><span> </span><span id="local-6989586621680847902"><span class="annot"><span class="annottext">UnivCoProvenance
</span><a href="#local-6989586621680847902"><span class="hs-identifier hs-var">p</span></a></span></span><span> </span><span class="annot"><span class="annottext">Role
</span><span class="hs-identifier">_</span></span><span> </span><span id="local-6989586621680847901"><span class="annot"><span class="annottext">Type
</span><a href="#local-6989586621680847901"><span class="hs-identifier hs-var">t1</span></a></span></span><span> </span><span id="local-6989586621680847900"><span class="annot"><span class="annottext">Type
</span><a href="#local-6989586621680847900"><span class="hs-identifier hs-var">t2</span></a></span></span><span class="hs-special">)</span><span> </span><span id="local-6989586621680847899"><span class="annot"><span class="annottext">InterestingVarFun
</span><a href="#local-6989586621680847899"><span class="hs-identifier hs-var">fv_cand</span></a></span></span><span> </span><span id="local-6989586621680847898"><span class="annot"><span class="annottext">VarSet
</span><a href="#local-6989586621680847898"><span class="hs-identifier hs-var">in_scope</span></a></span></span><span> </span><span id="local-6989586621680847897"><span class="annot"><span class="annottext">([TyCoVar], VarSet)
</span><a href="#local-6989586621680847897"><span class="hs-identifier hs-var">acc</span></a></span></span><span>
</span><span id="line-633"></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">UnivCoProvenance -&gt; FV
</span><a href="GHC.Core.TyCo.FVs.html#tyCoFVsOfProv"><span class="hs-identifier hs-var">tyCoFVsOfProv</span></a></span><span> </span><span class="annot"><span class="annottext">UnivCoProvenance
</span><a href="#local-6989586621680847902"><span class="hs-identifier hs-var">p</span></a></span><span> </span><span class="annot"><span class="annottext">FV -&gt; FV -&gt; FV
</span><a href="GHC.Utils.FV.html#unionFV"><span class="hs-operator hs-var">`unionFV`</span></a></span><span> </span><span class="annot"><span class="annottext">Type -&gt; FV
</span><a href="GHC.Core.TyCo.FVs.html#tyCoFVsOfType"><span class="hs-identifier hs-var">tyCoFVsOfType</span></a></span><span> </span><span class="annot"><span class="annottext">Type
</span><a href="#local-6989586621680847901"><span class="hs-identifier hs-var">t1</span></a></span><span>
</span><span id="line-634"></span><span>                     </span><span class="annot"><span class="annottext">FV -&gt; FV -&gt; FV
</span><a href="GHC.Utils.FV.html#unionFV"><span class="hs-operator hs-var">`unionFV`</span></a></span><span> </span><span class="annot"><span class="annottext">Type -&gt; FV
</span><a href="GHC.Core.TyCo.FVs.html#tyCoFVsOfType"><span class="hs-identifier hs-var">tyCoFVsOfType</span></a></span><span> </span><span class="annot"><span class="annottext">Type
</span><a href="#local-6989586621680847900"><span class="hs-identifier hs-var">t2</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">InterestingVarFun
</span><a href="#local-6989586621680847899"><span class="hs-identifier hs-var">fv_cand</span></a></span><span> </span><span class="annot"><span class="annottext">VarSet
</span><a href="#local-6989586621680847898"><span class="hs-identifier hs-var">in_scope</span></a></span><span> </span><span class="annot"><span class="annottext">([TyCoVar], VarSet)
</span><a href="#local-6989586621680847897"><span class="hs-identifier hs-var">acc</span></a></span><span>
</span><span id="line-635"></span><span class="annot"><a href="GHC.Core.TyCo.FVs.html#tyCoFVsOfCo"><span class="hs-identifier hs-var">tyCoFVsOfCo</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Core.TyCo.Rep.html#SymCo"><span class="hs-identifier hs-type">SymCo</span></a></span><span> </span><span id="local-6989586621680847894"><span class="annot"><span class="annottext">Coercion
</span><a href="#local-6989586621680847894"><span class="hs-identifier hs-var">co</span></a></span></span><span class="hs-special">)</span><span>          </span><span id="local-6989586621680847893"><span class="annot"><span class="annottext">InterestingVarFun
</span><a href="#local-6989586621680847893"><span class="hs-identifier hs-var">fv_cand</span></a></span></span><span> </span><span id="local-6989586621680847892"><span class="annot"><span class="annottext">VarSet
</span><a href="#local-6989586621680847892"><span class="hs-identifier hs-var">in_scope</span></a></span></span><span> </span><span id="local-6989586621680847891"><span class="annot"><span class="annottext">([TyCoVar], VarSet)
</span><a href="#local-6989586621680847891"><span class="hs-identifier hs-var">acc</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Coercion -&gt; FV
</span><a href="GHC.Core.TyCo.FVs.html#tyCoFVsOfCo"><span class="hs-identifier hs-var">tyCoFVsOfCo</span></a></span><span> </span><span class="annot"><span class="annottext">Coercion
</span><a href="#local-6989586621680847894"><span class="hs-identifier hs-var">co</span></a></span><span> </span><span class="annot"><span class="annottext">InterestingVarFun
</span><a href="#local-6989586621680847893"><span class="hs-identifier hs-var">fv_cand</span></a></span><span> </span><span class="annot"><span class="annottext">VarSet
</span><a href="#local-6989586621680847892"><span class="hs-identifier hs-var">in_scope</span></a></span><span> </span><span class="annot"><span class="annottext">([TyCoVar], VarSet)
</span><a href="#local-6989586621680847891"><span class="hs-identifier hs-var">acc</span></a></span><span>
</span><span id="line-636"></span><span class="annot"><a href="GHC.Core.TyCo.FVs.html#tyCoFVsOfCo"><span class="hs-identifier hs-var">tyCoFVsOfCo</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Core.TyCo.Rep.html#TransCo"><span class="hs-identifier hs-type">TransCo</span></a></span><span> </span><span id="local-6989586621680847889"><span class="annot"><span class="annottext">Coercion
</span><a href="#local-6989586621680847889"><span class="hs-identifier hs-var">co1</span></a></span></span><span> </span><span id="local-6989586621680847888"><span class="annot"><span class="annottext">Coercion
</span><a href="#local-6989586621680847888"><span class="hs-identifier hs-var">co2</span></a></span></span><span class="hs-special">)</span><span>   </span><span id="local-6989586621680847887"><span class="annot"><span class="annottext">InterestingVarFun
</span><a href="#local-6989586621680847887"><span class="hs-identifier hs-var">fv_cand</span></a></span></span><span> </span><span id="local-6989586621680847886"><span class="annot"><span class="annottext">VarSet
</span><a href="#local-6989586621680847886"><span class="hs-identifier hs-var">in_scope</span></a></span></span><span> </span><span id="local-6989586621680847885"><span class="annot"><span class="annottext">([TyCoVar], VarSet)
</span><a href="#local-6989586621680847885"><span class="hs-identifier hs-var">acc</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Coercion -&gt; FV
</span><a href="GHC.Core.TyCo.FVs.html#tyCoFVsOfCo"><span class="hs-identifier hs-var">tyCoFVsOfCo</span></a></span><span> </span><span class="annot"><span class="annottext">Coercion
</span><a href="#local-6989586621680847889"><span class="hs-identifier hs-var">co1</span></a></span><span> </span><span class="annot"><span class="annottext">FV -&gt; FV -&gt; FV
</span><a href="GHC.Utils.FV.html#unionFV"><span class="hs-operator hs-var">`unionFV`</span></a></span><span> </span><span class="annot"><span class="annottext">Coercion -&gt; FV
</span><a href="GHC.Core.TyCo.FVs.html#tyCoFVsOfCo"><span class="hs-identifier hs-var">tyCoFVsOfCo</span></a></span><span> </span><span class="annot"><span class="annottext">Coercion
</span><a href="#local-6989586621680847888"><span class="hs-identifier hs-var">co2</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">InterestingVarFun
</span><a href="#local-6989586621680847887"><span class="hs-identifier hs-var">fv_cand</span></a></span><span> </span><span class="annot"><span class="annottext">VarSet
</span><a href="#local-6989586621680847886"><span class="hs-identifier hs-var">in_scope</span></a></span><span> </span><span class="annot"><span class="annottext">([TyCoVar], VarSet)
</span><a href="#local-6989586621680847885"><span class="hs-identifier hs-var">acc</span></a></span><span>
</span><span id="line-637"></span><span class="annot"><a href="GHC.Core.TyCo.FVs.html#tyCoFVsOfCo"><span class="hs-identifier hs-var">tyCoFVsOfCo</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Core.TyCo.Rep.html#NthCo"><span class="hs-identifier hs-type">NthCo</span></a></span><span> </span><span class="annot"><span class="annottext">Role
</span><span class="hs-identifier">_</span></span><span> </span><span class="annot"><span class="annottext">BranchIndex
</span><span class="hs-identifier">_</span></span><span> </span><span id="local-6989586621680847883"><span class="annot"><span class="annottext">Coercion
</span><a href="#local-6989586621680847883"><span class="hs-identifier hs-var">co</span></a></span></span><span class="hs-special">)</span><span>      </span><span id="local-6989586621680847882"><span class="annot"><span class="annottext">InterestingVarFun
</span><a href="#local-6989586621680847882"><span class="hs-identifier hs-var">fv_cand</span></a></span></span><span> </span><span id="local-6989586621680847881"><span class="annot"><span class="annottext">VarSet
</span><a href="#local-6989586621680847881"><span class="hs-identifier hs-var">in_scope</span></a></span></span><span> </span><span id="local-6989586621680847880"><span class="annot"><span class="annottext">([TyCoVar], VarSet)
</span><a href="#local-6989586621680847880"><span class="hs-identifier hs-var">acc</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Coercion -&gt; FV
</span><a href="GHC.Core.TyCo.FVs.html#tyCoFVsOfCo"><span class="hs-identifier hs-var">tyCoFVsOfCo</span></a></span><span> </span><span class="annot"><span class="annottext">Coercion
</span><a href="#local-6989586621680847883"><span class="hs-identifier hs-var">co</span></a></span><span> </span><span class="annot"><span class="annottext">InterestingVarFun
</span><a href="#local-6989586621680847882"><span class="hs-identifier hs-var">fv_cand</span></a></span><span> </span><span class="annot"><span class="annottext">VarSet
</span><a href="#local-6989586621680847881"><span class="hs-identifier hs-var">in_scope</span></a></span><span> </span><span class="annot"><span class="annottext">([TyCoVar], VarSet)
</span><a href="#local-6989586621680847880"><span class="hs-identifier hs-var">acc</span></a></span><span>
</span><span id="line-638"></span><span class="annot"><a href="GHC.Core.TyCo.FVs.html#tyCoFVsOfCo"><span class="hs-identifier hs-var">tyCoFVsOfCo</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Core.TyCo.Rep.html#LRCo"><span class="hs-identifier hs-type">LRCo</span></a></span><span> </span><span class="annot"><span class="annottext">LeftOrRight
</span><span class="hs-identifier">_</span></span><span> </span><span id="local-6989586621680847878"><span class="annot"><span class="annottext">Coercion
</span><a href="#local-6989586621680847878"><span class="hs-identifier hs-var">co</span></a></span></span><span class="hs-special">)</span><span>         </span><span id="local-6989586621680847877"><span class="annot"><span class="annottext">InterestingVarFun
</span><a href="#local-6989586621680847877"><span class="hs-identifier hs-var">fv_cand</span></a></span></span><span> </span><span id="local-6989586621680847876"><span class="annot"><span class="annottext">VarSet
</span><a href="#local-6989586621680847876"><span class="hs-identifier hs-var">in_scope</span></a></span></span><span> </span><span id="local-6989586621680847875"><span class="annot"><span class="annottext">([TyCoVar], VarSet)
</span><a href="#local-6989586621680847875"><span class="hs-identifier hs-var">acc</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Coercion -&gt; FV
</span><a href="GHC.Core.TyCo.FVs.html#tyCoFVsOfCo"><span class="hs-identifier hs-var">tyCoFVsOfCo</span></a></span><span> </span><span class="annot"><span class="annottext">Coercion
</span><a href="#local-6989586621680847878"><span class="hs-identifier hs-var">co</span></a></span><span> </span><span class="annot"><span class="annottext">InterestingVarFun
</span><a href="#local-6989586621680847877"><span class="hs-identifier hs-var">fv_cand</span></a></span><span> </span><span class="annot"><span class="annottext">VarSet
</span><a href="#local-6989586621680847876"><span class="hs-identifier hs-var">in_scope</span></a></span><span> </span><span class="annot"><span class="annottext">([TyCoVar], VarSet)
</span><a href="#local-6989586621680847875"><span class="hs-identifier hs-var">acc</span></a></span><span>
</span><span id="line-639"></span><span class="annot"><a href="GHC.Core.TyCo.FVs.html#tyCoFVsOfCo"><span class="hs-identifier hs-var">tyCoFVsOfCo</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Core.TyCo.Rep.html#InstCo"><span class="hs-identifier hs-type">InstCo</span></a></span><span> </span><span id="local-6989586621680847873"><span class="annot"><span class="annottext">Coercion
</span><a href="#local-6989586621680847873"><span class="hs-identifier hs-var">co</span></a></span></span><span> </span><span id="local-6989586621680847872"><span class="annot"><span class="annottext">Coercion
</span><a href="#local-6989586621680847872"><span class="hs-identifier hs-var">arg</span></a></span></span><span class="hs-special">)</span><span>     </span><span id="local-6989586621680847871"><span class="annot"><span class="annottext">InterestingVarFun
</span><a href="#local-6989586621680847871"><span class="hs-identifier hs-var">fv_cand</span></a></span></span><span> </span><span id="local-6989586621680847870"><span class="annot"><span class="annottext">VarSet
</span><a href="#local-6989586621680847870"><span class="hs-identifier hs-var">in_scope</span></a></span></span><span> </span><span id="local-6989586621680847869"><span class="annot"><span class="annottext">([TyCoVar], VarSet)
</span><a href="#local-6989586621680847869"><span class="hs-identifier hs-var">acc</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Coercion -&gt; FV
</span><a href="GHC.Core.TyCo.FVs.html#tyCoFVsOfCo"><span class="hs-identifier hs-var">tyCoFVsOfCo</span></a></span><span> </span><span class="annot"><span class="annottext">Coercion
</span><a href="#local-6989586621680847873"><span class="hs-identifier hs-var">co</span></a></span><span> </span><span class="annot"><span class="annottext">FV -&gt; FV -&gt; FV
</span><a href="GHC.Utils.FV.html#unionFV"><span class="hs-operator hs-var">`unionFV`</span></a></span><span> </span><span class="annot"><span class="annottext">Coercion -&gt; FV
</span><a href="GHC.Core.TyCo.FVs.html#tyCoFVsOfCo"><span class="hs-identifier hs-var">tyCoFVsOfCo</span></a></span><span> </span><span class="annot"><span class="annottext">Coercion
</span><a href="#local-6989586621680847872"><span class="hs-identifier hs-var">arg</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">InterestingVarFun
</span><a href="#local-6989586621680847871"><span class="hs-identifier hs-var">fv_cand</span></a></span><span> </span><span class="annot"><span class="annottext">VarSet
</span><a href="#local-6989586621680847870"><span class="hs-identifier hs-var">in_scope</span></a></span><span> </span><span class="annot"><span class="annottext">([TyCoVar], VarSet)
</span><a href="#local-6989586621680847869"><span class="hs-identifier hs-var">acc</span></a></span><span>
</span><span id="line-640"></span><span class="annot"><a href="GHC.Core.TyCo.FVs.html#tyCoFVsOfCo"><span class="hs-identifier hs-var">tyCoFVsOfCo</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Core.TyCo.Rep.html#KindCo"><span class="hs-identifier hs-type">KindCo</span></a></span><span> </span><span id="local-6989586621680847867"><span class="annot"><span class="annottext">Coercion
</span><a href="#local-6989586621680847867"><span class="hs-identifier hs-var">co</span></a></span></span><span class="hs-special">)</span><span>         </span><span id="local-6989586621680847866"><span class="annot"><span class="annottext">InterestingVarFun
</span><a href="#local-6989586621680847866"><span class="hs-identifier hs-var">fv_cand</span></a></span></span><span> </span><span id="local-6989586621680847865"><span class="annot"><span class="annottext">VarSet
</span><a href="#local-6989586621680847865"><span class="hs-identifier hs-var">in_scope</span></a></span></span><span> </span><span id="local-6989586621680847864"><span class="annot"><span class="annottext">([TyCoVar], VarSet)
</span><a href="#local-6989586621680847864"><span class="hs-identifier hs-var">acc</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Coercion -&gt; FV
</span><a href="GHC.Core.TyCo.FVs.html#tyCoFVsOfCo"><span class="hs-identifier hs-var">tyCoFVsOfCo</span></a></span><span> </span><span class="annot"><span class="annottext">Coercion
</span><a href="#local-6989586621680847867"><span class="hs-identifier hs-var">co</span></a></span><span> </span><span class="annot"><span class="annottext">InterestingVarFun
</span><a href="#local-6989586621680847866"><span class="hs-identifier hs-var">fv_cand</span></a></span><span> </span><span class="annot"><span class="annottext">VarSet
</span><a href="#local-6989586621680847865"><span class="hs-identifier hs-var">in_scope</span></a></span><span> </span><span class="annot"><span class="annottext">([TyCoVar], VarSet)
</span><a href="#local-6989586621680847864"><span class="hs-identifier hs-var">acc</span></a></span><span>
</span><span id="line-641"></span><span class="annot"><a href="GHC.Core.TyCo.FVs.html#tyCoFVsOfCo"><span class="hs-identifier hs-var">tyCoFVsOfCo</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Core.TyCo.Rep.html#SubCo"><span class="hs-identifier hs-type">SubCo</span></a></span><span> </span><span id="local-6989586621680847862"><span class="annot"><span class="annottext">Coercion
</span><a href="#local-6989586621680847862"><span class="hs-identifier hs-var">co</span></a></span></span><span class="hs-special">)</span><span>          </span><span id="local-6989586621680847861"><span class="annot"><span class="annottext">InterestingVarFun
</span><a href="#local-6989586621680847861"><span class="hs-identifier hs-var">fv_cand</span></a></span></span><span> </span><span id="local-6989586621680847860"><span class="annot"><span class="annottext">VarSet
</span><a href="#local-6989586621680847860"><span class="hs-identifier hs-var">in_scope</span></a></span></span><span> </span><span id="local-6989586621680847859"><span class="annot"><span class="annottext">([TyCoVar], VarSet)
</span><a href="#local-6989586621680847859"><span class="hs-identifier hs-var">acc</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Coercion -&gt; FV
</span><a href="GHC.Core.TyCo.FVs.html#tyCoFVsOfCo"><span class="hs-identifier hs-var">tyCoFVsOfCo</span></a></span><span> </span><span class="annot"><span class="annottext">Coercion
</span><a href="#local-6989586621680847862"><span class="hs-identifier hs-var">co</span></a></span><span> </span><span class="annot"><span class="annottext">InterestingVarFun
</span><a href="#local-6989586621680847861"><span class="hs-identifier hs-var">fv_cand</span></a></span><span> </span><span class="annot"><span class="annottext">VarSet
</span><a href="#local-6989586621680847860"><span class="hs-identifier hs-var">in_scope</span></a></span><span> </span><span class="annot"><span class="annottext">([TyCoVar], VarSet)
</span><a href="#local-6989586621680847859"><span class="hs-identifier hs-var">acc</span></a></span><span>
</span><span id="line-642"></span><span class="annot"><a href="GHC.Core.TyCo.FVs.html#tyCoFVsOfCo"><span class="hs-identifier hs-var">tyCoFVsOfCo</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Core.TyCo.Rep.html#AxiomRuleCo"><span class="hs-identifier hs-type">AxiomRuleCo</span></a></span><span> </span><span class="annot"><span class="annottext">CoAxiomRule
</span><span class="hs-identifier">_</span></span><span> </span><span id="local-6989586621680847857"><span class="annot"><span class="annottext">[Coercion]
</span><a href="#local-6989586621680847857"><span class="hs-identifier hs-var">cs</span></a></span></span><span class="hs-special">)</span><span>  </span><span id="local-6989586621680847856"><span class="annot"><span class="annottext">InterestingVarFun
</span><a href="#local-6989586621680847856"><span class="hs-identifier hs-var">fv_cand</span></a></span></span><span> </span><span id="local-6989586621680847855"><span class="annot"><span class="annottext">VarSet
</span><a href="#local-6989586621680847855"><span class="hs-identifier hs-var">in_scope</span></a></span></span><span> </span><span id="local-6989586621680847854"><span class="annot"><span class="annottext">([TyCoVar], VarSet)
</span><a href="#local-6989586621680847854"><span class="hs-identifier hs-var">acc</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">[Coercion] -&gt; FV
</span><a href="GHC.Core.TyCo.FVs.html#tyCoFVsOfCos"><span class="hs-identifier hs-var">tyCoFVsOfCos</span></a></span><span> </span><span class="annot"><span class="annottext">[Coercion]
</span><a href="#local-6989586621680847857"><span class="hs-identifier hs-var">cs</span></a></span><span> </span><span class="annot"><span class="annottext">InterestingVarFun
</span><a href="#local-6989586621680847856"><span class="hs-identifier hs-var">fv_cand</span></a></span><span> </span><span class="annot"><span class="annottext">VarSet
</span><a href="#local-6989586621680847855"><span class="hs-identifier hs-var">in_scope</span></a></span><span> </span><span class="annot"><span class="annottext">([TyCoVar], VarSet)
</span><a href="#local-6989586621680847854"><span class="hs-identifier hs-var">acc</span></a></span><span>
</span><span id="line-643"></span><span>
</span><span id="line-644"></span><span class="annot"><a href="GHC.Core.TyCo.FVs.html#tyCoFVsOfCoVar"><span class="hs-identifier hs-type">tyCoFVsOfCoVar</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Types.Var.html#CoVar"><span class="hs-identifier hs-type">CoVar</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Utils.FV.html#FV"><span class="hs-identifier hs-type">FV</span></a></span><span>
</span><span id="line-645"></span><span id="tyCoFVsOfCoVar"><span class="annot"><span class="annottext">tyCoFVsOfCoVar :: TyCoVar -&gt; FV
</span><a href="GHC.Core.TyCo.FVs.html#tyCoFVsOfCoVar"><span class="hs-identifier hs-var hs-var">tyCoFVsOfCoVar</span></a></span></span><span> </span><span id="local-6989586621680847852"><span class="annot"><span class="annottext">TyCoVar
</span><a href="#local-6989586621680847852"><span class="hs-identifier hs-var">v</span></a></span></span><span> </span><span id="local-6989586621680847851"><span class="annot"><span class="annottext">InterestingVarFun
</span><a href="#local-6989586621680847851"><span class="hs-identifier hs-var">fv_cand</span></a></span></span><span> </span><span id="local-6989586621680847850"><span class="annot"><span class="annottext">VarSet
</span><a href="#local-6989586621680847850"><span class="hs-identifier hs-var">in_scope</span></a></span></span><span> </span><span id="local-6989586621680847849"><span class="annot"><span class="annottext">([TyCoVar], VarSet)
</span><a href="#local-6989586621680847849"><span class="hs-identifier hs-var">acc</span></a></span></span><span>
</span><span id="line-646"></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">TyCoVar -&gt; FV
</span><a href="GHC.Utils.FV.html#unitFV"><span class="hs-identifier hs-var">unitFV</span></a></span><span> </span><span class="annot"><span class="annottext">TyCoVar
</span><a href="#local-6989586621680847852"><span class="hs-identifier hs-var">v</span></a></span><span> </span><span class="annot"><span class="annottext">FV -&gt; FV -&gt; FV
</span><a href="GHC.Utils.FV.html#unionFV"><span class="hs-operator hs-var">`unionFV`</span></a></span><span> </span><span class="annot"><span class="annottext">Type -&gt; FV
</span><a href="GHC.Core.TyCo.FVs.html#tyCoFVsOfType"><span class="hs-identifier hs-var">tyCoFVsOfType</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">TyCoVar -&gt; Type
</span><a href="GHC.Types.Var.html#varType"><span class="hs-identifier hs-var hs-var">varType</span></a></span><span> </span><span class="annot"><span class="annottext">TyCoVar
</span><a href="#local-6989586621680847852"><span class="hs-identifier hs-var">v</span></a></span><span class="hs-special">)</span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">InterestingVarFun
</span><a href="#local-6989586621680847851"><span class="hs-identifier hs-var">fv_cand</span></a></span><span> </span><span class="annot"><span class="annottext">VarSet
</span><a href="#local-6989586621680847850"><span class="hs-identifier hs-var">in_scope</span></a></span><span> </span><span class="annot"><span class="annottext">([TyCoVar], VarSet)
</span><a href="#local-6989586621680847849"><span class="hs-identifier hs-var">acc</span></a></span><span>
</span><span id="line-647"></span><span>
</span><span id="line-648"></span><span class="annot"><a href="GHC.Core.TyCo.FVs.html#tyCoFVsOfProv"><span class="hs-identifier hs-type">tyCoFVsOfProv</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Core.TyCo.Rep.html#UnivCoProvenance"><span class="hs-identifier hs-type">UnivCoProvenance</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Utils.FV.html#FV"><span class="hs-identifier hs-type">FV</span></a></span><span>
</span><span id="line-649"></span><span id="tyCoFVsOfProv"><span class="annot"><span class="annottext">tyCoFVsOfProv :: UnivCoProvenance -&gt; FV
</span><a href="GHC.Core.TyCo.FVs.html#tyCoFVsOfProv"><span class="hs-identifier hs-var hs-var">tyCoFVsOfProv</span></a></span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Core.TyCo.Rep.html#PhantomProv"><span class="hs-identifier hs-type">PhantomProv</span></a></span><span> </span><span id="local-6989586621680847846"><span class="annot"><span class="annottext">Coercion
</span><a href="#local-6989586621680847846"><span class="hs-identifier hs-var">co</span></a></span></span><span class="hs-special">)</span><span>    </span><span id="local-6989586621680847845"><span class="annot"><span class="annottext">InterestingVarFun
</span><a href="#local-6989586621680847845"><span class="hs-identifier hs-var">fv_cand</span></a></span></span><span> </span><span id="local-6989586621680847844"><span class="annot"><span class="annottext">VarSet
</span><a href="#local-6989586621680847844"><span class="hs-identifier hs-var">in_scope</span></a></span></span><span> </span><span id="local-6989586621680847843"><span class="annot"><span class="annottext">([TyCoVar], VarSet)
</span><a href="#local-6989586621680847843"><span class="hs-identifier hs-var">acc</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Coercion -&gt; FV
</span><a href="GHC.Core.TyCo.FVs.html#tyCoFVsOfCo"><span class="hs-identifier hs-var">tyCoFVsOfCo</span></a></span><span> </span><span class="annot"><span class="annottext">Coercion
</span><a href="#local-6989586621680847846"><span class="hs-identifier hs-var">co</span></a></span><span> </span><span class="annot"><span class="annottext">InterestingVarFun
</span><a href="#local-6989586621680847845"><span class="hs-identifier hs-var">fv_cand</span></a></span><span> </span><span class="annot"><span class="annottext">VarSet
</span><a href="#local-6989586621680847844"><span class="hs-identifier hs-var">in_scope</span></a></span><span> </span><span class="annot"><span class="annottext">([TyCoVar], VarSet)
</span><a href="#local-6989586621680847843"><span class="hs-identifier hs-var">acc</span></a></span><span>
</span><span id="line-650"></span><span class="annot"><a href="GHC.Core.TyCo.FVs.html#tyCoFVsOfProv"><span class="hs-identifier hs-var">tyCoFVsOfProv</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Core.TyCo.Rep.html#ProofIrrelProv"><span class="hs-identifier hs-type">ProofIrrelProv</span></a></span><span> </span><span id="local-6989586621680847841"><span class="annot"><span class="annottext">Coercion
</span><a href="#local-6989586621680847841"><span class="hs-identifier hs-var">co</span></a></span></span><span class="hs-special">)</span><span> </span><span id="local-6989586621680847840"><span class="annot"><span class="annottext">InterestingVarFun
</span><a href="#local-6989586621680847840"><span class="hs-identifier hs-var">fv_cand</span></a></span></span><span> </span><span id="local-6989586621680847839"><span class="annot"><span class="annottext">VarSet
</span><a href="#local-6989586621680847839"><span class="hs-identifier hs-var">in_scope</span></a></span></span><span> </span><span id="local-6989586621680847838"><span class="annot"><span class="annottext">([TyCoVar], VarSet)
</span><a href="#local-6989586621680847838"><span class="hs-identifier hs-var">acc</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Coercion -&gt; FV
</span><a href="GHC.Core.TyCo.FVs.html#tyCoFVsOfCo"><span class="hs-identifier hs-var">tyCoFVsOfCo</span></a></span><span> </span><span class="annot"><span class="annottext">Coercion
</span><a href="#local-6989586621680847841"><span class="hs-identifier hs-var">co</span></a></span><span> </span><span class="annot"><span class="annottext">InterestingVarFun
</span><a href="#local-6989586621680847840"><span class="hs-identifier hs-var">fv_cand</span></a></span><span> </span><span class="annot"><span class="annottext">VarSet
</span><a href="#local-6989586621680847839"><span class="hs-identifier hs-var">in_scope</span></a></span><span> </span><span class="annot"><span class="annottext">([TyCoVar], VarSet)
</span><a href="#local-6989586621680847838"><span class="hs-identifier hs-var">acc</span></a></span><span>
</span><span id="line-651"></span><span class="annot"><a href="GHC.Core.TyCo.FVs.html#tyCoFVsOfProv"><span class="hs-identifier hs-var">tyCoFVsOfProv</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Core.TyCo.Rep.html#PluginProv"><span class="hs-identifier hs-type">PluginProv</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-identifier">_</span></span><span class="hs-special">)</span><span>      </span><span id="local-6989586621680847836"><span class="annot"><span class="annottext">InterestingVarFun
</span><a href="#local-6989586621680847836"><span class="hs-identifier hs-var">fv_cand</span></a></span></span><span> </span><span id="local-6989586621680847835"><span class="annot"><span class="annottext">VarSet
</span><a href="#local-6989586621680847835"><span class="hs-identifier hs-var">in_scope</span></a></span></span><span> </span><span id="local-6989586621680847834"><span class="annot"><span class="annottext">([TyCoVar], VarSet)
</span><a href="#local-6989586621680847834"><span class="hs-identifier hs-var">acc</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">FV
</span><a href="GHC.Utils.FV.html#emptyFV"><span class="hs-identifier hs-var">emptyFV</span></a></span><span> </span><span class="annot"><span class="annottext">InterestingVarFun
</span><a href="#local-6989586621680847836"><span class="hs-identifier hs-var">fv_cand</span></a></span><span> </span><span class="annot"><span class="annottext">VarSet
</span><a href="#local-6989586621680847835"><span class="hs-identifier hs-var">in_scope</span></a></span><span> </span><span class="annot"><span class="annottext">([TyCoVar], VarSet)
</span><a href="#local-6989586621680847834"><span class="hs-identifier hs-var">acc</span></a></span><span>
</span><span id="line-652"></span><span class="annot"><a href="GHC.Core.TyCo.FVs.html#tyCoFVsOfProv"><span class="hs-identifier hs-var">tyCoFVsOfProv</span></a></span><span> </span><span class="annot"><span class="annottext">UnivCoProvenance
</span><a href="GHC.Core.TyCo.Rep.html#CorePrepProv"><span class="hs-identifier hs-var">CorePrepProv</span></a></span><span>        </span><span id="local-6989586621680847832"><span class="annot"><span class="annottext">InterestingVarFun
</span><a href="#local-6989586621680847832"><span class="hs-identifier hs-var">fv_cand</span></a></span></span><span> </span><span id="local-6989586621680847831"><span class="annot"><span class="annottext">VarSet
</span><a href="#local-6989586621680847831"><span class="hs-identifier hs-var">in_scope</span></a></span></span><span> </span><span id="local-6989586621680847830"><span class="annot"><span class="annottext">([TyCoVar], VarSet)
</span><a href="#local-6989586621680847830"><span class="hs-identifier hs-var">acc</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">FV
</span><a href="GHC.Utils.FV.html#emptyFV"><span class="hs-identifier hs-var">emptyFV</span></a></span><span> </span><span class="annot"><span class="annottext">InterestingVarFun
</span><a href="#local-6989586621680847832"><span class="hs-identifier hs-var">fv_cand</span></a></span><span> </span><span class="annot"><span class="annottext">VarSet
</span><a href="#local-6989586621680847831"><span class="hs-identifier hs-var">in_scope</span></a></span><span> </span><span class="annot"><span class="annottext">([TyCoVar], VarSet)
</span><a href="#local-6989586621680847830"><span class="hs-identifier hs-var">acc</span></a></span><span>
</span><span id="line-653"></span><span>
</span><span id="line-654"></span><span class="annot"><a href="GHC.Core.TyCo.FVs.html#tyCoFVsOfCos"><span class="hs-identifier hs-type">tyCoFVsOfCos</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="hs-special">[</span><span class="annot"><a href="GHC.Core.TyCo.Rep.html#Coercion"><span class="hs-identifier hs-type">Coercion</span></a></span><span class="hs-special">]</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Utils.FV.html#FV"><span class="hs-identifier hs-type">FV</span></a></span><span>
</span><span id="line-655"></span><span id="tyCoFVsOfCos"><span class="annot"><span class="annottext">tyCoFVsOfCos :: [Coercion] -&gt; FV
</span><a href="GHC.Core.TyCo.FVs.html#tyCoFVsOfCos"><span class="hs-identifier hs-var hs-var">tyCoFVsOfCos</span></a></span></span><span> </span><span class="hs-special">[</span><span class="hs-special">]</span><span>       </span><span id="local-6989586621680847829"><span class="annot"><span class="annottext">InterestingVarFun
</span><a href="#local-6989586621680847829"><span class="hs-identifier hs-var">fv_cand</span></a></span></span><span> </span><span id="local-6989586621680847828"><span class="annot"><span class="annottext">VarSet
</span><a href="#local-6989586621680847828"><span class="hs-identifier hs-var">in_scope</span></a></span></span><span> </span><span id="local-6989586621680847827"><span class="annot"><span class="annottext">([TyCoVar], VarSet)
</span><a href="#local-6989586621680847827"><span class="hs-identifier hs-var">acc</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">FV
</span><a href="GHC.Utils.FV.html#emptyFV"><span class="hs-identifier hs-var">emptyFV</span></a></span><span> </span><span class="annot"><span class="annottext">InterestingVarFun
</span><a href="#local-6989586621680847829"><span class="hs-identifier hs-var">fv_cand</span></a></span><span> </span><span class="annot"><span class="annottext">VarSet
</span><a href="#local-6989586621680847828"><span class="hs-identifier hs-var">in_scope</span></a></span><span> </span><span class="annot"><span class="annottext">([TyCoVar], VarSet)
</span><a href="#local-6989586621680847827"><span class="hs-identifier hs-var">acc</span></a></span><span>
</span><span id="line-656"></span><span class="annot"><a href="GHC.Core.TyCo.FVs.html#tyCoFVsOfCos"><span class="hs-identifier hs-var">tyCoFVsOfCos</span></a></span><span> </span><span class="hs-special">(</span><span id="local-6989586621680847826"><span class="annot"><span class="annottext">Coercion
</span><a href="#local-6989586621680847826"><span class="hs-identifier hs-var">co</span></a></span></span><span class="annot"><span class="hs-glyph hs-type">:</span></span><span id="local-6989586621680847825"><span class="annot"><span class="annottext">[Coercion]
</span><a href="#local-6989586621680847825"><span class="hs-identifier hs-var">cos</span></a></span></span><span class="hs-special">)</span><span> </span><span id="local-6989586621680847824"><span class="annot"><span class="annottext">InterestingVarFun
</span><a href="#local-6989586621680847824"><span class="hs-identifier hs-var">fv_cand</span></a></span></span><span> </span><span id="local-6989586621680847823"><span class="annot"><span class="annottext">VarSet
</span><a href="#local-6989586621680847823"><span class="hs-identifier hs-var">in_scope</span></a></span></span><span> </span><span id="local-6989586621680847822"><span class="annot"><span class="annottext">([TyCoVar], VarSet)
</span><a href="#local-6989586621680847822"><span class="hs-identifier hs-var">acc</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Coercion -&gt; FV
</span><a href="GHC.Core.TyCo.FVs.html#tyCoFVsOfCo"><span class="hs-identifier hs-var">tyCoFVsOfCo</span></a></span><span> </span><span class="annot"><span class="annottext">Coercion
</span><a href="#local-6989586621680847826"><span class="hs-identifier hs-var">co</span></a></span><span> </span><span class="annot"><span class="annottext">FV -&gt; FV -&gt; FV
</span><a href="GHC.Utils.FV.html#unionFV"><span class="hs-operator hs-var">`unionFV`</span></a></span><span> </span><span class="annot"><span class="annottext">[Coercion] -&gt; FV
</span><a href="GHC.Core.TyCo.FVs.html#tyCoFVsOfCos"><span class="hs-identifier hs-var">tyCoFVsOfCos</span></a></span><span> </span><span class="annot"><span class="annottext">[Coercion]
</span><a href="#local-6989586621680847825"><span class="hs-identifier hs-var">cos</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">InterestingVarFun
</span><a href="#local-6989586621680847824"><span class="hs-identifier hs-var">fv_cand</span></a></span><span> </span><span class="annot"><span class="annottext">VarSet
</span><a href="#local-6989586621680847823"><span class="hs-identifier hs-var">in_scope</span></a></span><span> </span><span class="annot"><span class="annottext">([TyCoVar], VarSet)
</span><a href="#local-6989586621680847822"><span class="hs-identifier hs-var">acc</span></a></span><span>
</span><span id="line-657"></span><span>
</span><span id="line-658"></span><span>
</span><span id="line-659"></span><span class="hs-comment">----- Whether a covar is /Almost Devoid/ in a type or coercion ----</span><span>
</span><span id="line-660"></span><span>
</span><span id="line-661"></span><span class="hs-comment">-- | Given a covar and a coercion, returns True if covar is almost devoid in</span><span>
</span><span id="line-662"></span><span class="hs-comment">-- the coercion. That is, covar can only appear in Refl and GRefl.</span><span>
</span><span id="line-663"></span><span class="hs-comment">-- See last wrinkle in Note [Unused coercion variable in ForAllCo] in &quot;GHC.Core.Coercion&quot;</span><span>
</span><span id="line-664"></span><span class="annot"><a href="GHC.Core.TyCo.FVs.html#almostDevoidCoVarOfCo"><span class="hs-identifier hs-type">almostDevoidCoVarOfCo</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Types.Var.html#CoVar"><span class="hs-identifier hs-type">CoVar</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Core.TyCo.Rep.html#Coercion"><span class="hs-identifier hs-type">Coercion</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="hs-identifier hs-type">Bool</span></span><span>
</span><span id="line-665"></span><span id="almostDevoidCoVarOfCo"><span class="annot"><span class="annottext">almostDevoidCoVarOfCo :: TyCoVar -&gt; Coercion -&gt; Bool
</span><a href="GHC.Core.TyCo.FVs.html#almostDevoidCoVarOfCo"><span class="hs-identifier hs-var hs-var">almostDevoidCoVarOfCo</span></a></span></span><span> </span><span id="local-6989586621680847821"><span class="annot"><span class="annottext">TyCoVar
</span><a href="#local-6989586621680847821"><span class="hs-identifier hs-var">cv</span></a></span></span><span> </span><span id="local-6989586621680847820"><span class="annot"><span class="annottext">Coercion
</span><a href="#local-6989586621680847820"><span class="hs-identifier hs-var">co</span></a></span></span><span> </span><span class="hs-glyph">=</span><span>
</span><span id="line-666"></span><span>  </span><span class="annot"><span class="annottext">Coercion -&gt; InterestingVarFun
</span><a href="GHC.Core.TyCo.FVs.html#almost_devoid_co_var_of_co"><span class="hs-identifier hs-var">almost_devoid_co_var_of_co</span></a></span><span> </span><span class="annot"><span class="annottext">Coercion
</span><a href="#local-6989586621680847820"><span class="hs-identifier hs-var">co</span></a></span><span> </span><span class="annot"><span class="annottext">TyCoVar
</span><a href="#local-6989586621680847821"><span class="hs-identifier hs-var">cv</span></a></span><span>
</span><span id="line-667"></span><span>
</span><span id="line-668"></span><span class="annot"><a href="GHC.Core.TyCo.FVs.html#almost_devoid_co_var_of_co"><span class="hs-identifier hs-type">almost_devoid_co_var_of_co</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Core.TyCo.Rep.html#Coercion"><span class="hs-identifier hs-type">Coercion</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Types.Var.html#CoVar"><span class="hs-identifier hs-type">CoVar</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="hs-identifier hs-type">Bool</span></span><span>
</span><span id="line-669"></span><span id="almost_devoid_co_var_of_co"><span class="annot"><span class="annottext">almost_devoid_co_var_of_co :: Coercion -&gt; InterestingVarFun
</span><a href="GHC.Core.TyCo.FVs.html#almost_devoid_co_var_of_co"><span class="hs-identifier hs-var hs-var">almost_devoid_co_var_of_co</span></a></span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Core.TyCo.Rep.html#Refl"><span class="hs-identifier hs-type">Refl</span></a></span><span> </span><span class="hs-special">{</span><span class="hs-special">}</span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">TyCoVar
</span><span class="hs-identifier">_</span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Bool
</span><span class="hs-identifier hs-var">True</span></span><span>   </span><span class="hs-comment">-- covar is allowed in Refl and</span><span>
</span><span id="line-670"></span><span class="annot"><a href="GHC.Core.TyCo.FVs.html#almost_devoid_co_var_of_co"><span class="hs-identifier hs-var">almost_devoid_co_var_of_co</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Core.TyCo.Rep.html#GRefl"><span class="hs-identifier hs-type">GRefl</span></a></span><span> </span><span class="hs-special">{</span><span class="hs-special">}</span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">TyCoVar
</span><span class="hs-identifier">_</span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Bool
</span><span class="hs-identifier hs-var">True</span></span><span>  </span><span class="hs-comment">-- GRefl, so we don't look into</span><span>
</span><span id="line-671"></span><span>                                                </span><span class="hs-comment">-- the coercions</span><span>
</span><span id="line-672"></span><span class="annot"><a href="GHC.Core.TyCo.FVs.html#almost_devoid_co_var_of_co"><span class="hs-identifier hs-var">almost_devoid_co_var_of_co</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Core.TyCo.Rep.html#TyConAppCo"><span class="hs-identifier hs-type">TyConAppCo</span></a></span><span> </span><span class="annot"><span class="annottext">Role
</span><span class="hs-identifier">_</span></span><span> </span><span class="annot"><span class="annottext">TyCon
</span><span class="hs-identifier">_</span></span><span> </span><span id="local-6989586621680847818"><span class="annot"><span class="annottext">[Coercion]
</span><a href="#local-6989586621680847818"><span class="hs-identifier hs-var">cos</span></a></span></span><span class="hs-special">)</span><span> </span><span id="local-6989586621680847817"><span class="annot"><span class="annottext">TyCoVar
</span><a href="#local-6989586621680847817"><span class="hs-identifier hs-var">cv</span></a></span></span><span>
</span><span id="line-673"></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">[Coercion] -&gt; InterestingVarFun
</span><a href="GHC.Core.TyCo.FVs.html#almost_devoid_co_var_of_cos"><span class="hs-identifier hs-var">almost_devoid_co_var_of_cos</span></a></span><span> </span><span class="annot"><span class="annottext">[Coercion]
</span><a href="#local-6989586621680847818"><span class="hs-identifier hs-var">cos</span></a></span><span> </span><span class="annot"><span class="annottext">TyCoVar
</span><a href="#local-6989586621680847817"><span class="hs-identifier hs-var">cv</span></a></span><span>
</span><span id="line-674"></span><span class="annot"><a href="GHC.Core.TyCo.FVs.html#almost_devoid_co_var_of_co"><span class="hs-identifier hs-var">almost_devoid_co_var_of_co</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Core.TyCo.Rep.html#AppCo"><span class="hs-identifier hs-type">AppCo</span></a></span><span> </span><span id="local-6989586621680847815"><span class="annot"><span class="annottext">Coercion
</span><a href="#local-6989586621680847815"><span class="hs-identifier hs-var">co</span></a></span></span><span> </span><span id="local-6989586621680847814"><span class="annot"><span class="annottext">Coercion
</span><a href="#local-6989586621680847814"><span class="hs-identifier hs-var">arg</span></a></span></span><span class="hs-special">)</span><span> </span><span id="local-6989586621680847813"><span class="annot"><span class="annottext">TyCoVar
</span><a href="#local-6989586621680847813"><span class="hs-identifier hs-var">cv</span></a></span></span><span>
</span><span id="line-675"></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Coercion -&gt; InterestingVarFun
</span><a href="GHC.Core.TyCo.FVs.html#almost_devoid_co_var_of_co"><span class="hs-identifier hs-var">almost_devoid_co_var_of_co</span></a></span><span> </span><span class="annot"><span class="annottext">Coercion
</span><a href="#local-6989586621680847815"><span class="hs-identifier hs-var">co</span></a></span><span> </span><span class="annot"><span class="annottext">TyCoVar
</span><a href="#local-6989586621680847813"><span class="hs-identifier hs-var">cv</span></a></span><span>
</span><span id="line-676"></span><span>  </span><span class="annot"><span class="annottext">Bool -&gt; Bool -&gt; Bool
</span><span class="hs-operator hs-var">&amp;&amp;</span></span><span> </span><span class="annot"><span class="annottext">Coercion -&gt; InterestingVarFun
</span><a href="GHC.Core.TyCo.FVs.html#almost_devoid_co_var_of_co"><span class="hs-identifier hs-var">almost_devoid_co_var_of_co</span></a></span><span> </span><span class="annot"><span class="annottext">Coercion
</span><a href="#local-6989586621680847814"><span class="hs-identifier hs-var">arg</span></a></span><span> </span><span class="annot"><span class="annottext">TyCoVar
</span><a href="#local-6989586621680847813"><span class="hs-identifier hs-var">cv</span></a></span><span>
</span><span id="line-677"></span><span class="annot"><a href="GHC.Core.TyCo.FVs.html#almost_devoid_co_var_of_co"><span class="hs-identifier hs-var">almost_devoid_co_var_of_co</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Core.TyCo.Rep.html#ForAllCo"><span class="hs-identifier hs-type">ForAllCo</span></a></span><span> </span><span id="local-6989586621680847811"><span class="annot"><span class="annottext">TyCoVar
</span><a href="#local-6989586621680847811"><span class="hs-identifier hs-var">v</span></a></span></span><span> </span><span id="local-6989586621680847810"><span class="annot"><span class="annottext">Coercion
</span><a href="#local-6989586621680847810"><span class="hs-identifier hs-var">kind_co</span></a></span></span><span> </span><span id="local-6989586621680847809"><span class="annot"><span class="annottext">Coercion
</span><a href="#local-6989586621680847809"><span class="hs-identifier hs-var">co</span></a></span></span><span class="hs-special">)</span><span> </span><span id="local-6989586621680847808"><span class="annot"><span class="annottext">TyCoVar
</span><a href="#local-6989586621680847808"><span class="hs-identifier hs-var">cv</span></a></span></span><span>
</span><span id="line-678"></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Coercion -&gt; InterestingVarFun
</span><a href="GHC.Core.TyCo.FVs.html#almost_devoid_co_var_of_co"><span class="hs-identifier hs-var">almost_devoid_co_var_of_co</span></a></span><span> </span><span class="annot"><span class="annottext">Coercion
</span><a href="#local-6989586621680847810"><span class="hs-identifier hs-var">kind_co</span></a></span><span> </span><span class="annot"><span class="annottext">TyCoVar
</span><a href="#local-6989586621680847808"><span class="hs-identifier hs-var">cv</span></a></span><span>
</span><span id="line-679"></span><span>  </span><span class="annot"><span class="annottext">Bool -&gt; Bool -&gt; Bool
</span><span class="hs-operator hs-var">&amp;&amp;</span></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">TyCoVar
</span><a href="#local-6989586621680847811"><span class="hs-identifier hs-var">v</span></a></span><span> </span><span class="annot"><span class="annottext">TyCoVar -&gt; InterestingVarFun
forall a. Eq a =&gt; a -&gt; a -&gt; Bool
</span><span class="hs-operator hs-var">==</span></span><span> </span><span class="annot"><span class="annottext">TyCoVar
</span><a href="#local-6989586621680847808"><span class="hs-identifier hs-var">cv</span></a></span><span> </span><span class="annot"><span class="annottext">Bool -&gt; Bool -&gt; Bool
</span><span class="hs-operator hs-var">||</span></span><span> </span><span class="annot"><span class="annottext">Coercion -&gt; InterestingVarFun
</span><a href="GHC.Core.TyCo.FVs.html#almost_devoid_co_var_of_co"><span class="hs-identifier hs-var">almost_devoid_co_var_of_co</span></a></span><span> </span><span class="annot"><span class="annottext">Coercion
</span><a href="#local-6989586621680847809"><span class="hs-identifier hs-var">co</span></a></span><span> </span><span class="annot"><span class="annottext">TyCoVar
</span><a href="#local-6989586621680847808"><span class="hs-identifier hs-var">cv</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-680"></span><span class="annot"><a href="GHC.Core.TyCo.FVs.html#almost_devoid_co_var_of_co"><span class="hs-identifier hs-var">almost_devoid_co_var_of_co</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Core.TyCo.Rep.html#FunCo"><span class="hs-identifier hs-type">FunCo</span></a></span><span> </span><span class="annot"><span class="annottext">Role
</span><span class="hs-identifier">_</span></span><span> </span><span id="local-6989586621680847806"><span class="annot"><span class="annottext">Coercion
</span><a href="#local-6989586621680847806"><span class="hs-identifier hs-var">w</span></a></span></span><span> </span><span id="local-6989586621680847805"><span class="annot"><span class="annottext">Coercion
</span><a href="#local-6989586621680847805"><span class="hs-identifier hs-var">co1</span></a></span></span><span> </span><span id="local-6989586621680847804"><span class="annot"><span class="annottext">Coercion
</span><a href="#local-6989586621680847804"><span class="hs-identifier hs-var">co2</span></a></span></span><span class="hs-special">)</span><span> </span><span id="local-6989586621680847803"><span class="annot"><span class="annottext">TyCoVar
</span><a href="#local-6989586621680847803"><span class="hs-identifier hs-var">cv</span></a></span></span><span>
</span><span id="line-681"></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Coercion -&gt; InterestingVarFun
</span><a href="GHC.Core.TyCo.FVs.html#almost_devoid_co_var_of_co"><span class="hs-identifier hs-var">almost_devoid_co_var_of_co</span></a></span><span> </span><span class="annot"><span class="annottext">Coercion
</span><a href="#local-6989586621680847806"><span class="hs-identifier hs-var">w</span></a></span><span> </span><span class="annot"><span class="annottext">TyCoVar
</span><a href="#local-6989586621680847803"><span class="hs-identifier hs-var">cv</span></a></span><span>
</span><span id="line-682"></span><span>  </span><span class="annot"><span class="annottext">Bool -&gt; Bool -&gt; Bool
</span><span class="hs-operator hs-var">&amp;&amp;</span></span><span> </span><span class="annot"><span class="annottext">Coercion -&gt; InterestingVarFun
</span><a href="GHC.Core.TyCo.FVs.html#almost_devoid_co_var_of_co"><span class="hs-identifier hs-var">almost_devoid_co_var_of_co</span></a></span><span> </span><span class="annot"><span class="annottext">Coercion
</span><a href="#local-6989586621680847805"><span class="hs-identifier hs-var">co1</span></a></span><span> </span><span class="annot"><span class="annottext">TyCoVar
</span><a href="#local-6989586621680847803"><span class="hs-identifier hs-var">cv</span></a></span><span>
</span><span id="line-683"></span><span>  </span><span class="annot"><span class="annottext">Bool -&gt; Bool -&gt; Bool
</span><span class="hs-operator hs-var">&amp;&amp;</span></span><span> </span><span class="annot"><span class="annottext">Coercion -&gt; InterestingVarFun
</span><a href="GHC.Core.TyCo.FVs.html#almost_devoid_co_var_of_co"><span class="hs-identifier hs-var">almost_devoid_co_var_of_co</span></a></span><span> </span><span class="annot"><span class="annottext">Coercion
</span><a href="#local-6989586621680847804"><span class="hs-identifier hs-var">co2</span></a></span><span> </span><span class="annot"><span class="annottext">TyCoVar
</span><a href="#local-6989586621680847803"><span class="hs-identifier hs-var">cv</span></a></span><span>
</span><span id="line-684"></span><span class="annot"><a href="GHC.Core.TyCo.FVs.html#almost_devoid_co_var_of_co"><span class="hs-identifier hs-var">almost_devoid_co_var_of_co</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Core.TyCo.Rep.html#CoVarCo"><span class="hs-identifier hs-type">CoVarCo</span></a></span><span> </span><span id="local-6989586621680847802"><span class="annot"><span class="annottext">TyCoVar
</span><a href="#local-6989586621680847802"><span class="hs-identifier hs-var">v</span></a></span></span><span class="hs-special">)</span><span> </span><span id="local-6989586621680847801"><span class="annot"><span class="annottext">TyCoVar
</span><a href="#local-6989586621680847801"><span class="hs-identifier hs-var">cv</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">TyCoVar
</span><a href="#local-6989586621680847802"><span class="hs-identifier hs-var">v</span></a></span><span> </span><span class="annot"><span class="annottext">TyCoVar -&gt; InterestingVarFun
forall a. Eq a =&gt; a -&gt; a -&gt; Bool
</span><span class="hs-operator hs-var">/=</span></span><span> </span><span class="annot"><span class="annottext">TyCoVar
</span><a href="#local-6989586621680847801"><span class="hs-identifier hs-var">cv</span></a></span><span>
</span><span id="line-685"></span><span class="annot"><a href="GHC.Core.TyCo.FVs.html#almost_devoid_co_var_of_co"><span class="hs-identifier hs-var">almost_devoid_co_var_of_co</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Core.TyCo.Rep.html#HoleCo"><span class="hs-identifier hs-type">HoleCo</span></a></span><span> </span><span id="local-6989586621680847799"><span class="annot"><span class="annottext">CoercionHole
</span><a href="#local-6989586621680847799"><span class="hs-identifier hs-var">h</span></a></span></span><span class="hs-special">)</span><span>  </span><span id="local-6989586621680847798"><span class="annot"><span class="annottext">TyCoVar
</span><a href="#local-6989586621680847798"><span class="hs-identifier hs-var">cv</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">CoercionHole -&gt; TyCoVar
</span><a href="GHC.Core.TyCo.Rep.html#coHoleCoVar"><span class="hs-identifier hs-var">coHoleCoVar</span></a></span><span> </span><span class="annot"><span class="annottext">CoercionHole
</span><a href="#local-6989586621680847799"><span class="hs-identifier hs-var">h</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">TyCoVar -&gt; InterestingVarFun
forall a. Eq a =&gt; a -&gt; a -&gt; Bool
</span><span class="hs-operator hs-var">/=</span></span><span> </span><span class="annot"><span class="annottext">TyCoVar
</span><a href="#local-6989586621680847798"><span class="hs-identifier hs-var">cv</span></a></span><span>
</span><span id="line-686"></span><span class="annot"><a href="GHC.Core.TyCo.FVs.html#almost_devoid_co_var_of_co"><span class="hs-identifier hs-var">almost_devoid_co_var_of_co</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Core.TyCo.Rep.html#AxiomInstCo"><span class="hs-identifier hs-type">AxiomInstCo</span></a></span><span> </span><span class="annot"><span class="annottext">CoAxiom Branched
</span><span class="hs-identifier">_</span></span><span> </span><span class="annot"><span class="annottext">BranchIndex
</span><span class="hs-identifier">_</span></span><span> </span><span id="local-6989586621680847797"><span class="annot"><span class="annottext">[Coercion]
</span><a href="#local-6989586621680847797"><span class="hs-identifier hs-var">cos</span></a></span></span><span class="hs-special">)</span><span> </span><span id="local-6989586621680847796"><span class="annot"><span class="annottext">TyCoVar
</span><a href="#local-6989586621680847796"><span class="hs-identifier hs-var">cv</span></a></span></span><span>
</span><span id="line-687"></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">[Coercion] -&gt; InterestingVarFun
</span><a href="GHC.Core.TyCo.FVs.html#almost_devoid_co_var_of_cos"><span class="hs-identifier hs-var">almost_devoid_co_var_of_cos</span></a></span><span> </span><span class="annot"><span class="annottext">[Coercion]
</span><a href="#local-6989586621680847797"><span class="hs-identifier hs-var">cos</span></a></span><span> </span><span class="annot"><span class="annottext">TyCoVar
</span><a href="#local-6989586621680847796"><span class="hs-identifier hs-var">cv</span></a></span><span>
</span><span id="line-688"></span><span class="annot"><a href="GHC.Core.TyCo.FVs.html#almost_devoid_co_var_of_co"><span class="hs-identifier hs-var">almost_devoid_co_var_of_co</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Core.TyCo.Rep.html#UnivCo"><span class="hs-identifier hs-type">UnivCo</span></a></span><span> </span><span id="local-6989586621680847795"><span class="annot"><span class="annottext">UnivCoProvenance
</span><a href="#local-6989586621680847795"><span class="hs-identifier hs-var">p</span></a></span></span><span> </span><span class="annot"><span class="annottext">Role
</span><span class="hs-identifier">_</span></span><span> </span><span id="local-6989586621680847794"><span class="annot"><span class="annottext">Type
</span><a href="#local-6989586621680847794"><span class="hs-identifier hs-var">t1</span></a></span></span><span> </span><span id="local-6989586621680847793"><span class="annot"><span class="annottext">Type
</span><a href="#local-6989586621680847793"><span class="hs-identifier hs-var">t2</span></a></span></span><span class="hs-special">)</span><span> </span><span id="local-6989586621680847792"><span class="annot"><span class="annottext">TyCoVar
</span><a href="#local-6989586621680847792"><span class="hs-identifier hs-var">cv</span></a></span></span><span>
</span><span id="line-689"></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">UnivCoProvenance -&gt; InterestingVarFun
</span><a href="GHC.Core.TyCo.FVs.html#almost_devoid_co_var_of_prov"><span class="hs-identifier hs-var">almost_devoid_co_var_of_prov</span></a></span><span> </span><span class="annot"><span class="annottext">UnivCoProvenance
</span><a href="#local-6989586621680847795"><span class="hs-identifier hs-var">p</span></a></span><span> </span><span class="annot"><span class="annottext">TyCoVar
</span><a href="#local-6989586621680847792"><span class="hs-identifier hs-var">cv</span></a></span><span>
</span><span id="line-690"></span><span>  </span><span class="annot"><span class="annottext">Bool -&gt; Bool -&gt; Bool
</span><span class="hs-operator hs-var">&amp;&amp;</span></span><span> </span><span class="annot"><span class="annottext">Type -&gt; InterestingVarFun
</span><a href="GHC.Core.TyCo.FVs.html#almost_devoid_co_var_of_type"><span class="hs-identifier hs-var">almost_devoid_co_var_of_type</span></a></span><span> </span><span class="annot"><span class="annottext">Type
</span><a href="#local-6989586621680847794"><span class="hs-identifier hs-var">t1</span></a></span><span> </span><span class="annot"><span class="annottext">TyCoVar
</span><a href="#local-6989586621680847792"><span class="hs-identifier hs-var">cv</span></a></span><span>
</span><span id="line-691"></span><span>  </span><span class="annot"><span class="annottext">Bool -&gt; Bool -&gt; Bool
</span><span class="hs-operator hs-var">&amp;&amp;</span></span><span> </span><span class="annot"><span class="annottext">Type -&gt; InterestingVarFun
</span><a href="GHC.Core.TyCo.FVs.html#almost_devoid_co_var_of_type"><span class="hs-identifier hs-var">almost_devoid_co_var_of_type</span></a></span><span> </span><span class="annot"><span class="annottext">Type
</span><a href="#local-6989586621680847793"><span class="hs-identifier hs-var">t2</span></a></span><span> </span><span class="annot"><span class="annottext">TyCoVar
</span><a href="#local-6989586621680847792"><span class="hs-identifier hs-var">cv</span></a></span><span>
</span><span id="line-692"></span><span class="annot"><a href="GHC.Core.TyCo.FVs.html#almost_devoid_co_var_of_co"><span class="hs-identifier hs-var">almost_devoid_co_var_of_co</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Core.TyCo.Rep.html#SymCo"><span class="hs-identifier hs-type">SymCo</span></a></span><span> </span><span id="local-6989586621680847789"><span class="annot"><span class="annottext">Coercion
</span><a href="#local-6989586621680847789"><span class="hs-identifier hs-var">co</span></a></span></span><span class="hs-special">)</span><span> </span><span id="local-6989586621680847788"><span class="annot"><span class="annottext">TyCoVar
</span><a href="#local-6989586621680847788"><span class="hs-identifier hs-var">cv</span></a></span></span><span>
</span><span id="line-693"></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Coercion -&gt; InterestingVarFun
</span><a href="GHC.Core.TyCo.FVs.html#almost_devoid_co_var_of_co"><span class="hs-identifier hs-var">almost_devoid_co_var_of_co</span></a></span><span> </span><span class="annot"><span class="annottext">Coercion
</span><a href="#local-6989586621680847789"><span class="hs-identifier hs-var">co</span></a></span><span> </span><span class="annot"><span class="annottext">TyCoVar
</span><a href="#local-6989586621680847788"><span class="hs-identifier hs-var">cv</span></a></span><span>
</span><span id="line-694"></span><span class="annot"><a href="GHC.Core.TyCo.FVs.html#almost_devoid_co_var_of_co"><span class="hs-identifier hs-var">almost_devoid_co_var_of_co</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Core.TyCo.Rep.html#TransCo"><span class="hs-identifier hs-type">TransCo</span></a></span><span> </span><span id="local-6989586621680847787"><span class="annot"><span class="annottext">Coercion
</span><a href="#local-6989586621680847787"><span class="hs-identifier hs-var">co1</span></a></span></span><span> </span><span id="local-6989586621680847786"><span class="annot"><span class="annottext">Coercion
</span><a href="#local-6989586621680847786"><span class="hs-identifier hs-var">co2</span></a></span></span><span class="hs-special">)</span><span> </span><span id="local-6989586621680847785"><span class="annot"><span class="annottext">TyCoVar
</span><a href="#local-6989586621680847785"><span class="hs-identifier hs-var">cv</span></a></span></span><span>
</span><span id="line-695"></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Coercion -&gt; InterestingVarFun
</span><a href="GHC.Core.TyCo.FVs.html#almost_devoid_co_var_of_co"><span class="hs-identifier hs-var">almost_devoid_co_var_of_co</span></a></span><span> </span><span class="annot"><span class="annottext">Coercion
</span><a href="#local-6989586621680847787"><span class="hs-identifier hs-var">co1</span></a></span><span> </span><span class="annot"><span class="annottext">TyCoVar
</span><a href="#local-6989586621680847785"><span class="hs-identifier hs-var">cv</span></a></span><span>
</span><span id="line-696"></span><span>  </span><span class="annot"><span class="annottext">Bool -&gt; Bool -&gt; Bool
</span><span class="hs-operator hs-var">&amp;&amp;</span></span><span> </span><span class="annot"><span class="annottext">Coercion -&gt; InterestingVarFun
</span><a href="GHC.Core.TyCo.FVs.html#almost_devoid_co_var_of_co"><span class="hs-identifier hs-var">almost_devoid_co_var_of_co</span></a></span><span> </span><span class="annot"><span class="annottext">Coercion
</span><a href="#local-6989586621680847786"><span class="hs-identifier hs-var">co2</span></a></span><span> </span><span class="annot"><span class="annottext">TyCoVar
</span><a href="#local-6989586621680847785"><span class="hs-identifier hs-var">cv</span></a></span><span>
</span><span id="line-697"></span><span class="annot"><a href="GHC.Core.TyCo.FVs.html#almost_devoid_co_var_of_co"><span class="hs-identifier hs-var">almost_devoid_co_var_of_co</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Core.TyCo.Rep.html#NthCo"><span class="hs-identifier hs-type">NthCo</span></a></span><span> </span><span class="annot"><span class="annottext">Role
</span><span class="hs-identifier">_</span></span><span> </span><span class="annot"><span class="annottext">BranchIndex
</span><span class="hs-identifier">_</span></span><span> </span><span id="local-6989586621680847784"><span class="annot"><span class="annottext">Coercion
</span><a href="#local-6989586621680847784"><span class="hs-identifier hs-var">co</span></a></span></span><span class="hs-special">)</span><span> </span><span id="local-6989586621680847783"><span class="annot"><span class="annottext">TyCoVar
</span><a href="#local-6989586621680847783"><span class="hs-identifier hs-var">cv</span></a></span></span><span>
</span><span id="line-698"></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Coercion -&gt; InterestingVarFun
</span><a href="GHC.Core.TyCo.FVs.html#almost_devoid_co_var_of_co"><span class="hs-identifier hs-var">almost_devoid_co_var_of_co</span></a></span><span> </span><span class="annot"><span class="annottext">Coercion
</span><a href="#local-6989586621680847784"><span class="hs-identifier hs-var">co</span></a></span><span> </span><span class="annot"><span class="annottext">TyCoVar
</span><a href="#local-6989586621680847783"><span class="hs-identifier hs-var">cv</span></a></span><span>
</span><span id="line-699"></span><span class="annot"><a href="GHC.Core.TyCo.FVs.html#almost_devoid_co_var_of_co"><span class="hs-identifier hs-var">almost_devoid_co_var_of_co</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Core.TyCo.Rep.html#LRCo"><span class="hs-identifier hs-type">LRCo</span></a></span><span> </span><span class="annot"><span class="annottext">LeftOrRight
</span><span class="hs-identifier">_</span></span><span> </span><span id="local-6989586621680847782"><span class="annot"><span class="annottext">Coercion
</span><a href="#local-6989586621680847782"><span class="hs-identifier hs-var">co</span></a></span></span><span class="hs-special">)</span><span> </span><span id="local-6989586621680847781"><span class="annot"><span class="annottext">TyCoVar
</span><a href="#local-6989586621680847781"><span class="hs-identifier hs-var">cv</span></a></span></span><span>
</span><span id="line-700"></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Coercion -&gt; InterestingVarFun
</span><a href="GHC.Core.TyCo.FVs.html#almost_devoid_co_var_of_co"><span class="hs-identifier hs-var">almost_devoid_co_var_of_co</span></a></span><span> </span><span class="annot"><span class="annottext">Coercion
</span><a href="#local-6989586621680847782"><span class="hs-identifier hs-var">co</span></a></span><span> </span><span class="annot"><span class="annottext">TyCoVar
</span><a href="#local-6989586621680847781"><span class="hs-identifier hs-var">cv</span></a></span><span>
</span><span id="line-701"></span><span class="annot"><a href="GHC.Core.TyCo.FVs.html#almost_devoid_co_var_of_co"><span class="hs-identifier hs-var">almost_devoid_co_var_of_co</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Core.TyCo.Rep.html#InstCo"><span class="hs-identifier hs-type">InstCo</span></a></span><span> </span><span id="local-6989586621680847780"><span class="annot"><span class="annottext">Coercion
</span><a href="#local-6989586621680847780"><span class="hs-identifier hs-var">co</span></a></span></span><span> </span><span id="local-6989586621680847779"><span class="annot"><span class="annottext">Coercion
</span><a href="#local-6989586621680847779"><span class="hs-identifier hs-var">arg</span></a></span></span><span class="hs-special">)</span><span> </span><span id="local-6989586621680847778"><span class="annot"><span class="annottext">TyCoVar
</span><a href="#local-6989586621680847778"><span class="hs-identifier hs-var">cv</span></a></span></span><span>
</span><span id="line-702"></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Coercion -&gt; InterestingVarFun
</span><a href="GHC.Core.TyCo.FVs.html#almost_devoid_co_var_of_co"><span class="hs-identifier hs-var">almost_devoid_co_var_of_co</span></a></span><span> </span><span class="annot"><span class="annottext">Coercion
</span><a href="#local-6989586621680847780"><span class="hs-identifier hs-var">co</span></a></span><span> </span><span class="annot"><span class="annottext">TyCoVar
</span><a href="#local-6989586621680847778"><span class="hs-identifier hs-var">cv</span></a></span><span>
</span><span id="line-703"></span><span>  </span><span class="annot"><span class="annottext">Bool -&gt; Bool -&gt; Bool
</span><span class="hs-operator hs-var">&amp;&amp;</span></span><span> </span><span class="annot"><span class="annottext">Coercion -&gt; InterestingVarFun
</span><a href="GHC.Core.TyCo.FVs.html#almost_devoid_co_var_of_co"><span class="hs-identifier hs-var">almost_devoid_co_var_of_co</span></a></span><span> </span><span class="annot"><span class="annottext">Coercion
</span><a href="#local-6989586621680847779"><span class="hs-identifier hs-var">arg</span></a></span><span> </span><span class="annot"><span class="annottext">TyCoVar
</span><a href="#local-6989586621680847778"><span class="hs-identifier hs-var">cv</span></a></span><span>
</span><span id="line-704"></span><span class="annot"><a href="GHC.Core.TyCo.FVs.html#almost_devoid_co_var_of_co"><span class="hs-identifier hs-var">almost_devoid_co_var_of_co</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Core.TyCo.Rep.html#KindCo"><span class="hs-identifier hs-type">KindCo</span></a></span><span> </span><span id="local-6989586621680847777"><span class="annot"><span class="annottext">Coercion
</span><a href="#local-6989586621680847777"><span class="hs-identifier hs-var">co</span></a></span></span><span class="hs-special">)</span><span> </span><span id="local-6989586621680847776"><span class="annot"><span class="annottext">TyCoVar
</span><a href="#local-6989586621680847776"><span class="hs-identifier hs-var">cv</span></a></span></span><span>
</span><span id="line-705"></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Coercion -&gt; InterestingVarFun
</span><a href="GHC.Core.TyCo.FVs.html#almost_devoid_co_var_of_co"><span class="hs-identifier hs-var">almost_devoid_co_var_of_co</span></a></span><span> </span><span class="annot"><span class="annottext">Coercion
</span><a href="#local-6989586621680847777"><span class="hs-identifier hs-var">co</span></a></span><span> </span><span class="annot"><span class="annottext">TyCoVar
</span><a href="#local-6989586621680847776"><span class="hs-identifier hs-var">cv</span></a></span><span>
</span><span id="line-706"></span><span class="annot"><a href="GHC.Core.TyCo.FVs.html#almost_devoid_co_var_of_co"><span class="hs-identifier hs-var">almost_devoid_co_var_of_co</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Core.TyCo.Rep.html#SubCo"><span class="hs-identifier hs-type">SubCo</span></a></span><span> </span><span id="local-6989586621680847775"><span class="annot"><span class="annottext">Coercion
</span><a href="#local-6989586621680847775"><span class="hs-identifier hs-var">co</span></a></span></span><span class="hs-special">)</span><span> </span><span id="local-6989586621680847774"><span class="annot"><span class="annottext">TyCoVar
</span><a href="#local-6989586621680847774"><span class="hs-identifier hs-var">cv</span></a></span></span><span>
</span><span id="line-707"></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Coercion -&gt; InterestingVarFun
</span><a href="GHC.Core.TyCo.FVs.html#almost_devoid_co_var_of_co"><span class="hs-identifier hs-var">almost_devoid_co_var_of_co</span></a></span><span> </span><span class="annot"><span class="annottext">Coercion
</span><a href="#local-6989586621680847775"><span class="hs-identifier hs-var">co</span></a></span><span> </span><span class="annot"><span class="annottext">TyCoVar
</span><a href="#local-6989586621680847774"><span class="hs-identifier hs-var">cv</span></a></span><span>
</span><span id="line-708"></span><span class="annot"><a href="GHC.Core.TyCo.FVs.html#almost_devoid_co_var_of_co"><span class="hs-identifier hs-var">almost_devoid_co_var_of_co</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Core.TyCo.Rep.html#AxiomRuleCo"><span class="hs-identifier hs-type">AxiomRuleCo</span></a></span><span> </span><span class="annot"><span class="annottext">CoAxiomRule
</span><span class="hs-identifier">_</span></span><span> </span><span id="local-6989586621680847773"><span class="annot"><span class="annottext">[Coercion]
</span><a href="#local-6989586621680847773"><span class="hs-identifier hs-var">cs</span></a></span></span><span class="hs-special">)</span><span> </span><span id="local-6989586621680847772"><span class="annot"><span class="annottext">TyCoVar
</span><a href="#local-6989586621680847772"><span class="hs-identifier hs-var">cv</span></a></span></span><span>
</span><span id="line-709"></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">[Coercion] -&gt; InterestingVarFun
</span><a href="GHC.Core.TyCo.FVs.html#almost_devoid_co_var_of_cos"><span class="hs-identifier hs-var">almost_devoid_co_var_of_cos</span></a></span><span> </span><span class="annot"><span class="annottext">[Coercion]
</span><a href="#local-6989586621680847773"><span class="hs-identifier hs-var">cs</span></a></span><span> </span><span class="annot"><span class="annottext">TyCoVar
</span><a href="#local-6989586621680847772"><span class="hs-identifier hs-var">cv</span></a></span><span>
</span><span id="line-710"></span><span>
</span><span id="line-711"></span><span class="annot"><a href="GHC.Core.TyCo.FVs.html#almost_devoid_co_var_of_cos"><span class="hs-identifier hs-type">almost_devoid_co_var_of_cos</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="hs-special">[</span><span class="annot"><a href="GHC.Core.TyCo.Rep.html#Coercion"><span class="hs-identifier hs-type">Coercion</span></a></span><span class="hs-special">]</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Types.Var.html#CoVar"><span class="hs-identifier hs-type">CoVar</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="hs-identifier hs-type">Bool</span></span><span>
</span><span id="line-712"></span><span id="almost_devoid_co_var_of_cos"><span class="annot"><span class="annottext">almost_devoid_co_var_of_cos :: [Coercion] -&gt; InterestingVarFun
</span><a href="GHC.Core.TyCo.FVs.html#almost_devoid_co_var_of_cos"><span class="hs-identifier hs-var hs-var">almost_devoid_co_var_of_cos</span></a></span></span><span> </span><span class="hs-special">[</span><span class="hs-special">]</span><span> </span><span class="annot"><span class="annottext">TyCoVar
</span><span class="hs-identifier">_</span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Bool
</span><span class="hs-identifier hs-var">True</span></span><span>
</span><span id="line-713"></span><span class="annot"><a href="GHC.Core.TyCo.FVs.html#almost_devoid_co_var_of_cos"><span class="hs-identifier hs-var">almost_devoid_co_var_of_cos</span></a></span><span> </span><span class="hs-special">(</span><span id="local-6989586621680847771"><span class="annot"><span class="annottext">Coercion
</span><a href="#local-6989586621680847771"><span class="hs-identifier hs-var">co</span></a></span></span><span class="annot"><span class="hs-glyph hs-type">:</span></span><span id="local-6989586621680847770"><span class="annot"><span class="annottext">[Coercion]
</span><a href="#local-6989586621680847770"><span class="hs-identifier hs-var">cos</span></a></span></span><span class="hs-special">)</span><span> </span><span id="local-6989586621680847769"><span class="annot"><span class="annottext">TyCoVar
</span><a href="#local-6989586621680847769"><span class="hs-identifier hs-var">cv</span></a></span></span><span>
</span><span id="line-714"></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Coercion -&gt; InterestingVarFun
</span><a href="GHC.Core.TyCo.FVs.html#almost_devoid_co_var_of_co"><span class="hs-identifier hs-var">almost_devoid_co_var_of_co</span></a></span><span> </span><span class="annot"><span class="annottext">Coercion
</span><a href="#local-6989586621680847771"><span class="hs-identifier hs-var">co</span></a></span><span> </span><span class="annot"><span class="annottext">TyCoVar
</span><a href="#local-6989586621680847769"><span class="hs-identifier hs-var">cv</span></a></span><span>
</span><span id="line-715"></span><span>  </span><span class="annot"><span class="annottext">Bool -&gt; Bool -&gt; Bool
</span><span class="hs-operator hs-var">&amp;&amp;</span></span><span> </span><span class="annot"><span class="annottext">[Coercion] -&gt; InterestingVarFun
</span><a href="GHC.Core.TyCo.FVs.html#almost_devoid_co_var_of_cos"><span class="hs-identifier hs-var">almost_devoid_co_var_of_cos</span></a></span><span> </span><span class="annot"><span class="annottext">[Coercion]
</span><a href="#local-6989586621680847770"><span class="hs-identifier hs-var">cos</span></a></span><span> </span><span class="annot"><span class="annottext">TyCoVar
</span><a href="#local-6989586621680847769"><span class="hs-identifier hs-var">cv</span></a></span><span>
</span><span id="line-716"></span><span>
</span><span id="line-717"></span><span class="annot"><a href="GHC.Core.TyCo.FVs.html#almost_devoid_co_var_of_prov"><span class="hs-identifier hs-type">almost_devoid_co_var_of_prov</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Core.TyCo.Rep.html#UnivCoProvenance"><span class="hs-identifier hs-type">UnivCoProvenance</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Types.Var.html#CoVar"><span class="hs-identifier hs-type">CoVar</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="hs-identifier hs-type">Bool</span></span><span>
</span><span id="line-718"></span><span id="almost_devoid_co_var_of_prov"><span class="annot"><span class="annottext">almost_devoid_co_var_of_prov :: UnivCoProvenance -&gt; InterestingVarFun
</span><a href="GHC.Core.TyCo.FVs.html#almost_devoid_co_var_of_prov"><span class="hs-identifier hs-var hs-var">almost_devoid_co_var_of_prov</span></a></span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Core.TyCo.Rep.html#PhantomProv"><span class="hs-identifier hs-type">PhantomProv</span></a></span><span> </span><span id="local-6989586621680847768"><span class="annot"><span class="annottext">Coercion
</span><a href="#local-6989586621680847768"><span class="hs-identifier hs-var">co</span></a></span></span><span class="hs-special">)</span><span> </span><span id="local-6989586621680847767"><span class="annot"><span class="annottext">TyCoVar
</span><a href="#local-6989586621680847767"><span class="hs-identifier hs-var">cv</span></a></span></span><span>
</span><span id="line-719"></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Coercion -&gt; InterestingVarFun
</span><a href="GHC.Core.TyCo.FVs.html#almost_devoid_co_var_of_co"><span class="hs-identifier hs-var">almost_devoid_co_var_of_co</span></a></span><span> </span><span class="annot"><span class="annottext">Coercion
</span><a href="#local-6989586621680847768"><span class="hs-identifier hs-var">co</span></a></span><span> </span><span class="annot"><span class="annottext">TyCoVar
</span><a href="#local-6989586621680847767"><span class="hs-identifier hs-var">cv</span></a></span><span>
</span><span id="line-720"></span><span class="annot"><a href="GHC.Core.TyCo.FVs.html#almost_devoid_co_var_of_prov"><span class="hs-identifier hs-var">almost_devoid_co_var_of_prov</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Core.TyCo.Rep.html#ProofIrrelProv"><span class="hs-identifier hs-type">ProofIrrelProv</span></a></span><span> </span><span id="local-6989586621680847766"><span class="annot"><span class="annottext">Coercion
</span><a href="#local-6989586621680847766"><span class="hs-identifier hs-var">co</span></a></span></span><span class="hs-special">)</span><span> </span><span id="local-6989586621680847765"><span class="annot"><span class="annottext">TyCoVar
</span><a href="#local-6989586621680847765"><span class="hs-identifier hs-var">cv</span></a></span></span><span>
</span><span id="line-721"></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Coercion -&gt; InterestingVarFun
</span><a href="GHC.Core.TyCo.FVs.html#almost_devoid_co_var_of_co"><span class="hs-identifier hs-var">almost_devoid_co_var_of_co</span></a></span><span> </span><span class="annot"><span class="annottext">Coercion
</span><a href="#local-6989586621680847766"><span class="hs-identifier hs-var">co</span></a></span><span> </span><span class="annot"><span class="annottext">TyCoVar
</span><a href="#local-6989586621680847765"><span class="hs-identifier hs-var">cv</span></a></span><span>
</span><span id="line-722"></span><span class="annot"><a href="GHC.Core.TyCo.FVs.html#almost_devoid_co_var_of_prov"><span class="hs-identifier hs-var">almost_devoid_co_var_of_prov</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Core.TyCo.Rep.html#PluginProv"><span class="hs-identifier hs-type">PluginProv</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-identifier">_</span></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">TyCoVar
</span><span class="hs-identifier">_</span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Bool
</span><span class="hs-identifier hs-var">True</span></span><span>
</span><span id="line-723"></span><span class="annot"><a href="GHC.Core.TyCo.FVs.html#almost_devoid_co_var_of_prov"><span class="hs-identifier hs-var">almost_devoid_co_var_of_prov</span></a></span><span> </span><span class="annot"><span class="annottext">UnivCoProvenance
</span><a href="GHC.Core.TyCo.Rep.html#CorePrepProv"><span class="hs-identifier hs-var">CorePrepProv</span></a></span><span>   </span><span class="annot"><span class="annottext">TyCoVar
</span><span class="hs-identifier">_</span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Bool
</span><span class="hs-identifier hs-var">True</span></span><span>
</span><span id="line-724"></span><span>
</span><span id="line-725"></span><span class="annot"><a href="GHC.Core.TyCo.FVs.html#almost_devoid_co_var_of_type"><span class="hs-identifier hs-type">almost_devoid_co_var_of_type</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Core.TyCo.Rep.html#Type"><span class="hs-identifier hs-type">Type</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Types.Var.html#CoVar"><span class="hs-identifier hs-type">CoVar</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="hs-identifier hs-type">Bool</span></span><span>
</span><span id="line-726"></span><span id="almost_devoid_co_var_of_type"><span class="annot"><span class="annottext">almost_devoid_co_var_of_type :: Type -&gt; InterestingVarFun
</span><a href="GHC.Core.TyCo.FVs.html#almost_devoid_co_var_of_type"><span class="hs-identifier hs-var hs-var">almost_devoid_co_var_of_type</span></a></span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Core.TyCo.Rep.html#TyVarTy"><span class="hs-identifier hs-type">TyVarTy</span></a></span><span> </span><span class="annot"><span class="annottext">TyCoVar
</span><span class="hs-identifier">_</span></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">TyCoVar
</span><span class="hs-identifier">_</span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Bool
</span><span class="hs-identifier hs-var">True</span></span><span>
</span><span id="line-727"></span><span class="annot"><a href="GHC.Core.TyCo.FVs.html#almost_devoid_co_var_of_type"><span class="hs-identifier hs-var">almost_devoid_co_var_of_type</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Core.TyCo.Rep.html#TyConApp"><span class="hs-identifier hs-type">TyConApp</span></a></span><span> </span><span class="annot"><span class="annottext">TyCon
</span><span class="hs-identifier">_</span></span><span> </span><span id="local-6989586621680847764"><span class="annot"><span class="annottext">[Type]
</span><a href="#local-6989586621680847764"><span class="hs-identifier hs-var">tys</span></a></span></span><span class="hs-special">)</span><span> </span><span id="local-6989586621680847763"><span class="annot"><span class="annottext">TyCoVar
</span><a href="#local-6989586621680847763"><span class="hs-identifier hs-var">cv</span></a></span></span><span>
</span><span id="line-728"></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">[Type] -&gt; InterestingVarFun
</span><a href="GHC.Core.TyCo.FVs.html#almost_devoid_co_var_of_types"><span class="hs-identifier hs-var">almost_devoid_co_var_of_types</span></a></span><span> </span><span class="annot"><span class="annottext">[Type]
</span><a href="#local-6989586621680847764"><span class="hs-identifier hs-var">tys</span></a></span><span> </span><span class="annot"><span class="annottext">TyCoVar
</span><a href="#local-6989586621680847763"><span class="hs-identifier hs-var">cv</span></a></span><span>
</span><span id="line-729"></span><span class="annot"><a href="GHC.Core.TyCo.FVs.html#almost_devoid_co_var_of_type"><span class="hs-identifier hs-var">almost_devoid_co_var_of_type</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Core.TyCo.Rep.html#LitTy"><span class="hs-identifier hs-type">LitTy</span></a></span><span> </span><span class="hs-special">{</span><span class="hs-special">}</span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">TyCoVar
</span><span class="hs-identifier">_</span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Bool
</span><span class="hs-identifier hs-var">True</span></span><span>
</span><span id="line-730"></span><span class="annot"><a href="GHC.Core.TyCo.FVs.html#almost_devoid_co_var_of_type"><span class="hs-identifier hs-var">almost_devoid_co_var_of_type</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Core.TyCo.Rep.html#AppTy"><span class="hs-identifier hs-type">AppTy</span></a></span><span> </span><span id="local-6989586621680847761"><span class="annot"><span class="annottext">Type
</span><a href="#local-6989586621680847761"><span class="hs-identifier hs-var">fun</span></a></span></span><span> </span><span id="local-6989586621680847760"><span class="annot"><span class="annottext">Type
</span><a href="#local-6989586621680847760"><span class="hs-identifier hs-var">arg</span></a></span></span><span class="hs-special">)</span><span> </span><span id="local-6989586621680847759"><span class="annot"><span class="annottext">TyCoVar
</span><a href="#local-6989586621680847759"><span class="hs-identifier hs-var">cv</span></a></span></span><span>
</span><span id="line-731"></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Type -&gt; InterestingVarFun
</span><a href="GHC.Core.TyCo.FVs.html#almost_devoid_co_var_of_type"><span class="hs-identifier hs-var">almost_devoid_co_var_of_type</span></a></span><span> </span><span class="annot"><span class="annottext">Type
</span><a href="#local-6989586621680847761"><span class="hs-identifier hs-var">fun</span></a></span><span> </span><span class="annot"><span class="annottext">TyCoVar
</span><a href="#local-6989586621680847759"><span class="hs-identifier hs-var">cv</span></a></span><span>
</span><span id="line-732"></span><span>  </span><span class="annot"><span class="annottext">Bool -&gt; Bool -&gt; Bool
</span><span class="hs-operator hs-var">&amp;&amp;</span></span><span> </span><span class="annot"><span class="annottext">Type -&gt; InterestingVarFun
</span><a href="GHC.Core.TyCo.FVs.html#almost_devoid_co_var_of_type"><span class="hs-identifier hs-var">almost_devoid_co_var_of_type</span></a></span><span> </span><span class="annot"><span class="annottext">Type
</span><a href="#local-6989586621680847760"><span class="hs-identifier hs-var">arg</span></a></span><span> </span><span class="annot"><span class="annottext">TyCoVar
</span><a href="#local-6989586621680847759"><span class="hs-identifier hs-var">cv</span></a></span><span>
</span><span id="line-733"></span><span class="annot"><a href="GHC.Core.TyCo.FVs.html#almost_devoid_co_var_of_type"><span class="hs-identifier hs-var">almost_devoid_co_var_of_type</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Core.TyCo.Rep.html#FunTy"><span class="hs-identifier hs-type">FunTy</span></a></span><span> </span><span class="annot"><span class="annottext">AnonArgFlag
</span><span class="hs-identifier">_</span></span><span> </span><span id="local-6989586621680847758"><span class="annot"><span class="annottext">Type
</span><a href="#local-6989586621680847758"><span class="hs-identifier hs-var">w</span></a></span></span><span> </span><span id="local-6989586621680847757"><span class="annot"><span class="annottext">Type
</span><a href="#local-6989586621680847757"><span class="hs-identifier hs-var">arg</span></a></span></span><span> </span><span id="local-6989586621680847756"><span class="annot"><span class="annottext">Type
</span><a href="#local-6989586621680847756"><span class="hs-identifier hs-var">res</span></a></span></span><span class="hs-special">)</span><span> </span><span id="local-6989586621680847755"><span class="annot"><span class="annottext">TyCoVar
</span><a href="#local-6989586621680847755"><span class="hs-identifier hs-var">cv</span></a></span></span><span>
</span><span id="line-734"></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Type -&gt; InterestingVarFun
</span><a href="GHC.Core.TyCo.FVs.html#almost_devoid_co_var_of_type"><span class="hs-identifier hs-var">almost_devoid_co_var_of_type</span></a></span><span> </span><span class="annot"><span class="annottext">Type
</span><a href="#local-6989586621680847758"><span class="hs-identifier hs-var">w</span></a></span><span> </span><span class="annot"><span class="annottext">TyCoVar
</span><a href="#local-6989586621680847755"><span class="hs-identifier hs-var">cv</span></a></span><span>
</span><span id="line-735"></span><span>  </span><span class="annot"><span class="annottext">Bool -&gt; Bool -&gt; Bool
</span><span class="hs-operator hs-var">&amp;&amp;</span></span><span> </span><span class="annot"><span class="annottext">Type -&gt; InterestingVarFun
</span><a href="GHC.Core.TyCo.FVs.html#almost_devoid_co_var_of_type"><span class="hs-identifier hs-var">almost_devoid_co_var_of_type</span></a></span><span> </span><span class="annot"><span class="annottext">Type
</span><a href="#local-6989586621680847757"><span class="hs-identifier hs-var">arg</span></a></span><span> </span><span class="annot"><span class="annottext">TyCoVar
</span><a href="#local-6989586621680847755"><span class="hs-identifier hs-var">cv</span></a></span><span>
</span><span id="line-736"></span><span>  </span><span class="annot"><span class="annottext">Bool -&gt; Bool -&gt; Bool
</span><span class="hs-operator hs-var">&amp;&amp;</span></span><span> </span><span class="annot"><span class="annottext">Type -&gt; InterestingVarFun
</span><a href="GHC.Core.TyCo.FVs.html#almost_devoid_co_var_of_type"><span class="hs-identifier hs-var">almost_devoid_co_var_of_type</span></a></span><span> </span><span class="annot"><span class="annottext">Type
</span><a href="#local-6989586621680847756"><span class="hs-identifier hs-var">res</span></a></span><span> </span><span class="annot"><span class="annottext">TyCoVar
</span><a href="#local-6989586621680847755"><span class="hs-identifier hs-var">cv</span></a></span><span>
</span><span id="line-737"></span><span class="annot"><a href="GHC.Core.TyCo.FVs.html#almost_devoid_co_var_of_type"><span class="hs-identifier hs-var">almost_devoid_co_var_of_type</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Core.TyCo.Rep.html#ForAllTy"><span class="hs-identifier hs-type">ForAllTy</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Types.Var.html#Bndr"><span class="hs-identifier hs-type">Bndr</span></a></span><span> </span><span id="local-6989586621680847754"><span class="annot"><span class="annottext">TyCoVar
</span><a href="#local-6989586621680847754"><span class="hs-identifier hs-var">v</span></a></span></span><span> </span><span class="annot"><span class="annottext">ArgFlag
</span><span class="hs-identifier">_</span></span><span class="hs-special">)</span><span> </span><span id="local-6989586621680847753"><span class="annot"><span class="annottext">Type
</span><a href="#local-6989586621680847753"><span class="hs-identifier hs-var">ty</span></a></span></span><span class="hs-special">)</span><span> </span><span id="local-6989586621680847752"><span class="annot"><span class="annottext">TyCoVar
</span><a href="#local-6989586621680847752"><span class="hs-identifier hs-var">cv</span></a></span></span><span>
</span><span id="line-738"></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Type -&gt; InterestingVarFun
</span><a href="GHC.Core.TyCo.FVs.html#almost_devoid_co_var_of_type"><span class="hs-identifier hs-var">almost_devoid_co_var_of_type</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">TyCoVar -&gt; Type
</span><a href="GHC.Types.Var.html#varType"><span class="hs-identifier hs-var hs-var">varType</span></a></span><span> </span><span class="annot"><span class="annottext">TyCoVar
</span><a href="#local-6989586621680847754"><span class="hs-identifier hs-var">v</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">TyCoVar
</span><a href="#local-6989586621680847752"><span class="hs-identifier hs-var">cv</span></a></span><span>
</span><span id="line-739"></span><span>  </span><span class="annot"><span class="annottext">Bool -&gt; Bool -&gt; Bool
</span><span class="hs-operator hs-var">&amp;&amp;</span></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">TyCoVar
</span><a href="#local-6989586621680847754"><span class="hs-identifier hs-var">v</span></a></span><span> </span><span class="annot"><span class="annottext">TyCoVar -&gt; InterestingVarFun
forall a. Eq a =&gt; a -&gt; a -&gt; Bool
</span><span class="hs-operator hs-var">==</span></span><span> </span><span class="annot"><span class="annottext">TyCoVar
</span><a href="#local-6989586621680847752"><span class="hs-identifier hs-var">cv</span></a></span><span> </span><span class="annot"><span class="annottext">Bool -&gt; Bool -&gt; Bool
</span><span class="hs-operator hs-var">||</span></span><span> </span><span class="annot"><span class="annottext">Type -&gt; InterestingVarFun
</span><a href="GHC.Core.TyCo.FVs.html#almost_devoid_co_var_of_type"><span class="hs-identifier hs-var">almost_devoid_co_var_of_type</span></a></span><span> </span><span class="annot"><span class="annottext">Type
</span><a href="#local-6989586621680847753"><span class="hs-identifier hs-var">ty</span></a></span><span> </span><span class="annot"><span class="annottext">TyCoVar
</span><a href="#local-6989586621680847752"><span class="hs-identifier hs-var">cv</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-740"></span><span class="annot"><a href="GHC.Core.TyCo.FVs.html#almost_devoid_co_var_of_type"><span class="hs-identifier hs-var">almost_devoid_co_var_of_type</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Core.TyCo.Rep.html#CastTy"><span class="hs-identifier hs-type">CastTy</span></a></span><span> </span><span id="local-6989586621680847751"><span class="annot"><span class="annottext">Type
</span><a href="#local-6989586621680847751"><span class="hs-identifier hs-var">ty</span></a></span></span><span> </span><span id="local-6989586621680847750"><span class="annot"><span class="annottext">Coercion
</span><a href="#local-6989586621680847750"><span class="hs-identifier hs-var">co</span></a></span></span><span class="hs-special">)</span><span> </span><span id="local-6989586621680847749"><span class="annot"><span class="annottext">TyCoVar
</span><a href="#local-6989586621680847749"><span class="hs-identifier hs-var">cv</span></a></span></span><span>
</span><span id="line-741"></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Type -&gt; InterestingVarFun
</span><a href="GHC.Core.TyCo.FVs.html#almost_devoid_co_var_of_type"><span class="hs-identifier hs-var">almost_devoid_co_var_of_type</span></a></span><span> </span><span class="annot"><span class="annottext">Type
</span><a href="#local-6989586621680847751"><span class="hs-identifier hs-var">ty</span></a></span><span> </span><span class="annot"><span class="annottext">TyCoVar
</span><a href="#local-6989586621680847749"><span class="hs-identifier hs-var">cv</span></a></span><span>
</span><span id="line-742"></span><span>  </span><span class="annot"><span class="annottext">Bool -&gt; Bool -&gt; Bool
</span><span class="hs-operator hs-var">&amp;&amp;</span></span><span> </span><span class="annot"><span class="annottext">Coercion -&gt; InterestingVarFun
</span><a href="GHC.Core.TyCo.FVs.html#almost_devoid_co_var_of_co"><span class="hs-identifier hs-var">almost_devoid_co_var_of_co</span></a></span><span> </span><span class="annot"><span class="annottext">Coercion
</span><a href="#local-6989586621680847750"><span class="hs-identifier hs-var">co</span></a></span><span> </span><span class="annot"><span class="annottext">TyCoVar
</span><a href="#local-6989586621680847749"><span class="hs-identifier hs-var">cv</span></a></span><span>
</span><span id="line-743"></span><span class="annot"><a href="GHC.Core.TyCo.FVs.html#almost_devoid_co_var_of_type"><span class="hs-identifier hs-var">almost_devoid_co_var_of_type</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Core.TyCo.Rep.html#CoercionTy"><span class="hs-identifier hs-type">CoercionTy</span></a></span><span> </span><span id="local-6989586621680847748"><span class="annot"><span class="annottext">Coercion
</span><a href="#local-6989586621680847748"><span class="hs-identifier hs-var">co</span></a></span></span><span class="hs-special">)</span><span> </span><span id="local-6989586621680847747"><span class="annot"><span class="annottext">TyCoVar
</span><a href="#local-6989586621680847747"><span class="hs-identifier hs-var">cv</span></a></span></span><span>
</span><span id="line-744"></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Coercion -&gt; InterestingVarFun
</span><a href="GHC.Core.TyCo.FVs.html#almost_devoid_co_var_of_co"><span class="hs-identifier hs-var">almost_devoid_co_var_of_co</span></a></span><span> </span><span class="annot"><span class="annottext">Coercion
</span><a href="#local-6989586621680847748"><span class="hs-identifier hs-var">co</span></a></span><span> </span><span class="annot"><span class="annottext">TyCoVar
</span><a href="#local-6989586621680847747"><span class="hs-identifier hs-var">cv</span></a></span><span>
</span><span id="line-745"></span><span>
</span><span id="line-746"></span><span class="annot"><a href="GHC.Core.TyCo.FVs.html#almost_devoid_co_var_of_types"><span class="hs-identifier hs-type">almost_devoid_co_var_of_types</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="hs-special">[</span><span class="annot"><a href="GHC.Core.TyCo.Rep.html#Type"><span class="hs-identifier hs-type">Type</span></a></span><span class="hs-special">]</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Types.Var.html#CoVar"><span class="hs-identifier hs-type">CoVar</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="hs-identifier hs-type">Bool</span></span><span>
</span><span id="line-747"></span><span id="almost_devoid_co_var_of_types"><span class="annot"><span class="annottext">almost_devoid_co_var_of_types :: [Type] -&gt; InterestingVarFun
</span><a href="GHC.Core.TyCo.FVs.html#almost_devoid_co_var_of_types"><span class="hs-identifier hs-var hs-var">almost_devoid_co_var_of_types</span></a></span></span><span> </span><span class="hs-special">[</span><span class="hs-special">]</span><span> </span><span class="annot"><span class="annottext">TyCoVar
</span><span class="hs-identifier">_</span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Bool
</span><span class="hs-identifier hs-var">True</span></span><span>
</span><span id="line-748"></span><span class="annot"><a href="GHC.Core.TyCo.FVs.html#almost_devoid_co_var_of_types"><span class="hs-identifier hs-var">almost_devoid_co_var_of_types</span></a></span><span> </span><span class="hs-special">(</span><span id="local-6989586621680847746"><span class="annot"><span class="annottext">Type
</span><a href="#local-6989586621680847746"><span class="hs-identifier hs-var">ty</span></a></span></span><span class="annot"><span class="hs-glyph hs-type">:</span></span><span id="local-6989586621680847745"><span class="annot"><span class="annottext">[Type]
</span><a href="#local-6989586621680847745"><span class="hs-identifier hs-var">tys</span></a></span></span><span class="hs-special">)</span><span> </span><span id="local-6989586621680847744"><span class="annot"><span class="annottext">TyCoVar
</span><a href="#local-6989586621680847744"><span class="hs-identifier hs-var">cv</span></a></span></span><span>
</span><span id="line-749"></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Type -&gt; InterestingVarFun
</span><a href="GHC.Core.TyCo.FVs.html#almost_devoid_co_var_of_type"><span class="hs-identifier hs-var">almost_devoid_co_var_of_type</span></a></span><span> </span><span class="annot"><span class="annottext">Type
</span><a href="#local-6989586621680847746"><span class="hs-identifier hs-var">ty</span></a></span><span> </span><span class="annot"><span class="annottext">TyCoVar
</span><a href="#local-6989586621680847744"><span class="hs-identifier hs-var">cv</span></a></span><span>
</span><span id="line-750"></span><span>  </span><span class="annot"><span class="annottext">Bool -&gt; Bool -&gt; Bool
</span><span class="hs-operator hs-var">&amp;&amp;</span></span><span> </span><span class="annot"><span class="annottext">[Type] -&gt; InterestingVarFun
</span><a href="GHC.Core.TyCo.FVs.html#almost_devoid_co_var_of_types"><span class="hs-identifier hs-var">almost_devoid_co_var_of_types</span></a></span><span> </span><span class="annot"><span class="annottext">[Type]
</span><a href="#local-6989586621680847745"><span class="hs-identifier hs-var">tys</span></a></span><span> </span><span class="annot"><span class="annottext">TyCoVar
</span><a href="#local-6989586621680847744"><span class="hs-identifier hs-var">cv</span></a></span><span>
</span><span id="line-751"></span><span>
</span><span id="line-752"></span><span>
</span><span id="line-753"></span><span>
</span><span id="line-754"></span><span class="hs-comment">{- *********************************************************************
*                                                                      *
                 Injective free vars
*                                                                      *
********************************************************************* -}</span><span>
</span><span id="line-759"></span><span>
</span><span id="line-760"></span><span class="hs-comment">-- | Returns the free variables of a 'Type' that are in injective positions.</span><span>
</span><span id="line-761"></span><span class="hs-comment">-- Specifically, it finds the free variables while:</span><span>
</span><span id="line-762"></span><span class="hs-comment">--</span><span>
</span><span id="line-763"></span><span class="hs-comment">-- * Expanding type synonyms</span><span>
</span><span id="line-764"></span><span class="hs-comment">--</span><span>
</span><span id="line-765"></span><span class="hs-comment">-- * Ignoring the coercion in @(ty |&gt; co)@</span><span>
</span><span id="line-766"></span><span class="hs-comment">--</span><span>
</span><span id="line-767"></span><span class="hs-comment">-- * Ignoring the non-injective fields of a 'TyConApp'</span><span>
</span><span id="line-768"></span><span class="hs-comment">--</span><span>
</span><span id="line-769"></span><span class="hs-comment">--</span><span>
</span><span id="line-770"></span><span class="hs-comment">-- For example, if @F@ is a non-injective type family, then:</span><span>
</span><span id="line-771"></span><span class="hs-comment">--</span><span>
</span><span id="line-772"></span><span class="hs-comment">-- @</span><span>
</span><span id="line-773"></span><span class="hs-comment">-- injectiveTyVarsOf( Either c (Maybe (a, F b c)) ) = {a,c}</span><span>
</span><span id="line-774"></span><span class="hs-comment">-- @</span><span>
</span><span id="line-775"></span><span class="hs-comment">--</span><span>
</span><span id="line-776"></span><span class="hs-comment">-- If @'injectiveVarsOfType' ty = itvs@, then knowing @ty@ fixes @itvs@.</span><span>
</span><span id="line-777"></span><span class="hs-comment">-- More formally, if</span><span>
</span><span id="line-778"></span><span class="hs-comment">-- @a@ is in @'injectiveVarsOfType' ty@</span><span>
</span><span id="line-779"></span><span class="hs-comment">-- and  @S1(ty) ~ S2(ty)@,</span><span>
</span><span id="line-780"></span><span class="hs-comment">-- then @S1(a)  ~ S2(a)@,</span><span>
</span><span id="line-781"></span><span class="hs-comment">-- where @S1@ and @S2@ are arbitrary substitutions.</span><span>
</span><span id="line-782"></span><span class="hs-comment">--</span><span>
</span><span id="line-783"></span><span class="hs-comment">-- See @Note [When does a tycon application need an explicit kind signature?]@.</span><span>
</span><span id="line-784"></span><span class="annot"><a href="GHC.Core.TyCo.FVs.html#injectiveVarsOfType"><span class="hs-identifier hs-type">injectiveVarsOfType</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><span class="hs-identifier hs-type">Bool</span></span><span>   </span><span class="hs-comment">-- ^ Should we look under injective type families?</span><span>
</span><span id="line-785"></span><span>                              </span><span class="hs-comment">-- See Note [Coverage condition for injective type families]</span><span>
</span><span id="line-786"></span><span>                              </span><span class="hs-comment">-- in &quot;GHC.Tc.Instance.Family&quot;.</span><span>
</span><span id="line-787"></span><span>                    </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Core.TyCo.Rep.html#Type"><span class="hs-identifier hs-type">Type</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Utils.FV.html#FV"><span class="hs-identifier hs-type">FV</span></a></span><span>
</span><span id="line-788"></span><span id="injectiveVarsOfType"><span class="annot"><span class="annottext">injectiveVarsOfType :: Bool -&gt; Type -&gt; FV
</span><a href="GHC.Core.TyCo.FVs.html#injectiveVarsOfType"><span class="hs-identifier hs-var hs-var">injectiveVarsOfType</span></a></span></span><span> </span><span id="local-6989586621680847743"><span class="annot"><span class="annottext">Bool
</span><a href="#local-6989586621680847743"><span class="hs-identifier hs-var">look_under_tfs</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Type -&gt; FV
</span><a href="#local-6989586621680847742"><span class="hs-identifier hs-var">go</span></a></span><span>
</span><span id="line-789"></span><span>  </span><span class="hs-keyword">where</span><span>
</span><span id="line-790"></span><span>    </span><span id="local-6989586621680847742"><span class="annot"><span class="annottext">go :: Type -&gt; FV
</span><a href="#local-6989586621680847742"><span class="hs-identifier hs-var hs-var">go</span></a></span></span><span> </span><span id="local-6989586621680847741"><span class="annot"><span class="annottext">Type
</span><a href="#local-6989586621680847741"><span class="hs-identifier hs-var">ty</span></a></span></span><span>                  </span><span class="hs-glyph">|</span><span> </span><span class="annot"><a href="../../base/src/GHC.Maybe.html#Just"><span class="hs-identifier hs-type">Just</span></a></span><span> </span><span id="local-6989586621680847740"><span class="annot"><span class="annottext">Type
</span><a href="#local-6989586621680847740"><span class="hs-identifier hs-var">ty'</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">Type -&gt; Maybe Type
</span><a href="GHC.Core.Type.html#coreView"><span class="hs-identifier hs-var">coreView</span></a></span><span> </span><span class="annot"><span class="annottext">Type
</span><a href="#local-6989586621680847741"><span class="hs-identifier hs-var">ty</span></a></span><span>
</span><span id="line-791"></span><span>                           </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Type -&gt; FV
</span><a href="#local-6989586621680847742"><span class="hs-identifier hs-var">go</span></a></span><span> </span><span class="annot"><span class="annottext">Type
</span><a href="#local-6989586621680847740"><span class="hs-identifier hs-var">ty'</span></a></span><span>
</span><span id="line-792"></span><span>    </span><span class="annot"><a href="#local-6989586621680847742"><span class="hs-identifier hs-var">go</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Core.TyCo.Rep.html#TyVarTy"><span class="hs-identifier hs-type">TyVarTy</span></a></span><span> </span><span id="local-6989586621680847739"><span class="annot"><span class="annottext">TyCoVar
</span><a href="#local-6989586621680847739"><span class="hs-identifier hs-var">v</span></a></span></span><span class="hs-special">)</span><span>         </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">TyCoVar -&gt; FV
</span><a href="GHC.Utils.FV.html#unitFV"><span class="hs-identifier hs-var">unitFV</span></a></span><span> </span><span class="annot"><span class="annottext">TyCoVar
</span><a href="#local-6989586621680847739"><span class="hs-identifier hs-var">v</span></a></span><span> </span><span class="annot"><span class="annottext">FV -&gt; FV -&gt; FV
</span><a href="GHC.Utils.FV.html#unionFV"><span class="hs-operator hs-var">`unionFV`</span></a></span><span> </span><span class="annot"><span class="annottext">Type -&gt; FV
</span><a href="#local-6989586621680847742"><span class="hs-identifier hs-var">go</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">TyCoVar -&gt; Type
</span><a href="GHC.Types.Var.html#tyVarKind"><span class="hs-identifier hs-var">tyVarKind</span></a></span><span> </span><span class="annot"><span class="annottext">TyCoVar
</span><a href="#local-6989586621680847739"><span class="hs-identifier hs-var">v</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-793"></span><span>    </span><span class="annot"><a href="#local-6989586621680847742"><span class="hs-identifier hs-var">go</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Core.TyCo.Rep.html#AppTy"><span class="hs-identifier hs-type">AppTy</span></a></span><span> </span><span id="local-6989586621680847738"><span class="annot"><span class="annottext">Type
</span><a href="#local-6989586621680847738"><span class="hs-identifier hs-var">f</span></a></span></span><span> </span><span id="local-6989586621680847737"><span class="annot"><span class="annottext">Type
</span><a href="#local-6989586621680847737"><span class="hs-identifier hs-var">a</span></a></span></span><span class="hs-special">)</span><span>         </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Type -&gt; FV
</span><a href="#local-6989586621680847742"><span class="hs-identifier hs-var">go</span></a></span><span> </span><span class="annot"><span class="annottext">Type
</span><a href="#local-6989586621680847738"><span class="hs-identifier hs-var">f</span></a></span><span> </span><span class="annot"><span class="annottext">FV -&gt; FV -&gt; FV
</span><a href="GHC.Utils.FV.html#unionFV"><span class="hs-operator hs-var">`unionFV`</span></a></span><span> </span><span class="annot"><span class="annottext">Type -&gt; FV
</span><a href="#local-6989586621680847742"><span class="hs-identifier hs-var">go</span></a></span><span> </span><span class="annot"><span class="annottext">Type
</span><a href="#local-6989586621680847737"><span class="hs-identifier hs-var">a</span></a></span><span>
</span><span id="line-794"></span><span>    </span><span class="annot"><a href="#local-6989586621680847742"><span class="hs-identifier hs-var">go</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Core.TyCo.Rep.html#FunTy"><span class="hs-identifier hs-type">FunTy</span></a></span><span> </span><span class="annot"><span class="annottext">AnonArgFlag
</span><span class="hs-identifier">_</span></span><span> </span><span id="local-6989586621680847736"><span class="annot"><span class="annottext">Type
</span><a href="#local-6989586621680847736"><span class="hs-identifier hs-var">w</span></a></span></span><span> </span><span id="local-6989586621680847735"><span class="annot"><span class="annottext">Type
</span><a href="#local-6989586621680847735"><span class="hs-identifier hs-var">ty1</span></a></span></span><span> </span><span id="local-6989586621680847734"><span class="annot"><span class="annottext">Type
</span><a href="#local-6989586621680847734"><span class="hs-identifier hs-var">ty2</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Type -&gt; FV
</span><a href="#local-6989586621680847742"><span class="hs-identifier hs-var">go</span></a></span><span> </span><span class="annot"><span class="annottext">Type
</span><a href="#local-6989586621680847736"><span class="hs-identifier hs-var">w</span></a></span><span> </span><span class="annot"><span class="annottext">FV -&gt; FV -&gt; FV
</span><a href="GHC.Utils.FV.html#unionFV"><span class="hs-operator hs-var">`unionFV`</span></a></span><span> </span><span class="annot"><span class="annottext">Type -&gt; FV
</span><a href="#local-6989586621680847742"><span class="hs-identifier hs-var">go</span></a></span><span> </span><span class="annot"><span class="annottext">Type
</span><a href="#local-6989586621680847735"><span class="hs-identifier hs-var">ty1</span></a></span><span> </span><span class="annot"><span class="annottext">FV -&gt; FV -&gt; FV
</span><a href="GHC.Utils.FV.html#unionFV"><span class="hs-operator hs-var">`unionFV`</span></a></span><span> </span><span class="annot"><span class="annottext">Type -&gt; FV
</span><a href="#local-6989586621680847742"><span class="hs-identifier hs-var">go</span></a></span><span> </span><span class="annot"><span class="annottext">Type
</span><a href="#local-6989586621680847734"><span class="hs-identifier hs-var">ty2</span></a></span><span>
</span><span id="line-795"></span><span>    </span><span class="annot"><a href="#local-6989586621680847742"><span class="hs-identifier hs-var">go</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Core.TyCo.Rep.html#TyConApp"><span class="hs-identifier hs-type">TyConApp</span></a></span><span> </span><span id="local-6989586621680847733"><span class="annot"><span class="annottext">TyCon
</span><a href="#local-6989586621680847733"><span class="hs-identifier hs-var">tc</span></a></span></span><span> </span><span id="local-6989586621680847732"><span class="annot"><span class="annottext">[Type]
</span><a href="#local-6989586621680847732"><span class="hs-identifier hs-var">tys</span></a></span></span><span class="hs-special">)</span><span>   </span><span class="hs-glyph">=</span><span>
</span><span id="line-796"></span><span>      </span><span class="hs-keyword">case</span><span> </span><span class="annot"><span class="annottext">TyCon -&gt; Injectivity
</span><a href="GHC.Core.TyCon.html#tyConInjectivityInfo"><span class="hs-identifier hs-var">tyConInjectivityInfo</span></a></span><span> </span><span class="annot"><span class="annottext">TyCon
</span><a href="#local-6989586621680847733"><span class="hs-identifier hs-var">tc</span></a></span><span> </span><span class="hs-keyword">of</span><span>
</span><span id="line-797"></span><span>        </span><span class="annot"><a href="GHC.Core.TyCon.html#Injective"><span class="hs-identifier hs-type">Injective</span></a></span><span> </span><span id="local-6989586621680847729"><span class="annot"><span class="annottext">[Bool]
</span><a href="#local-6989586621680847729"><span class="hs-identifier hs-var">inj</span></a></span></span><span>
</span><span id="line-798"></span><span>          </span><span class="hs-glyph">|</span><span>  </span><span class="annot"><span class="annottext">Bool
</span><a href="#local-6989586621680847743"><span class="hs-identifier hs-var">look_under_tfs</span></a></span><span> </span><span class="annot"><span class="annottext">Bool -&gt; Bool -&gt; Bool
</span><span class="hs-operator hs-var">||</span></span><span> </span><span class="annot"><span class="annottext">Bool -&gt; Bool
</span><span class="hs-identifier hs-var">not</span></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">TyCon -&gt; Bool
</span><a href="GHC.Core.TyCon.html#isTypeFamilyTyCon"><span class="hs-identifier hs-var">isTypeFamilyTyCon</span></a></span><span> </span><span class="annot"><span class="annottext">TyCon
</span><a href="#local-6989586621680847733"><span class="hs-identifier hs-var">tc</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-799"></span><span>          </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">(Type -&gt; FV) -&gt; [Type] -&gt; FV
forall a. (a -&gt; FV) -&gt; [a] -&gt; FV
</span><a href="GHC.Utils.FV.html#mapUnionFV"><span class="hs-identifier hs-var">mapUnionFV</span></a></span><span> </span><span class="annot"><span class="annottext">Type -&gt; FV
</span><a href="#local-6989586621680847742"><span class="hs-identifier hs-var">go</span></a></span><span> </span><span class="annot"><span class="annottext">([Type] -&gt; FV) -&gt; [Type] -&gt; FV
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span>
</span><span id="line-800"></span><span>             </span><span class="annot"><span class="annottext">[Bool] -&gt; [Type] -&gt; [Type]
forall a. [Bool] -&gt; [a] -&gt; [a]
</span><a href="GHC.Utils.Misc.html#filterByList"><span class="hs-identifier hs-var">filterByList</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">[Bool]
</span><a href="#local-6989586621680847729"><span class="hs-identifier hs-var">inj</span></a></span><span> </span><span class="annot"><span class="annottext">[Bool] -&gt; [Bool] -&gt; [Bool]
forall a. [a] -&gt; [a] -&gt; [a]
</span><a href="../../base/src/GHC.Base.html#%2B%2B"><span class="hs-operator hs-var">++</span></a></span><span> </span><span class="annot"><span class="annottext">Bool -&gt; [Bool]
forall a. a -&gt; [a]
</span><a href="../../base/src/GHC.List.html#repeat"><span class="hs-identifier hs-var">repeat</span></a></span><span> </span><span class="annot"><span class="annottext">Bool
</span><span class="hs-identifier hs-var">True</span></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">[Type]
</span><a href="#local-6989586621680847732"><span class="hs-identifier hs-var">tys</span></a></span><span>
</span><span id="line-801"></span><span>                         </span><span class="hs-comment">-- Oversaturated arguments to a tycon are</span><span>
</span><span id="line-802"></span><span>                         </span><span class="hs-comment">-- always injective, hence the repeat True</span><span>
</span><span id="line-803"></span><span>        </span><span class="annot"><span class="annottext">Injectivity
</span><span class="hs-identifier">_</span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">FV
</span><a href="GHC.Utils.FV.html#emptyFV"><span class="hs-identifier hs-var">emptyFV</span></a></span><span>
</span><span id="line-804"></span><span>    </span><span class="annot"><a href="#local-6989586621680847742"><span class="hs-identifier hs-var">go</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Core.TyCo.Rep.html#ForAllTy"><span class="hs-identifier hs-type">ForAllTy</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Types.Var.html#Bndr"><span class="hs-identifier hs-type">Bndr</span></a></span><span> </span><span id="local-6989586621680847725"><span class="annot"><span class="annottext">TyCoVar
</span><a href="#local-6989586621680847725"><span class="hs-identifier hs-var">tv</span></a></span></span><span> </span><span class="annot"><span class="annottext">ArgFlag
</span><span class="hs-identifier">_</span></span><span class="hs-special">)</span><span> </span><span id="local-6989586621680847724"><span class="annot"><span class="annottext">Type
</span><a href="#local-6989586621680847724"><span class="hs-identifier hs-var">ty</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Type -&gt; FV
</span><a href="#local-6989586621680847742"><span class="hs-identifier hs-var">go</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">TyCoVar -&gt; Type
</span><a href="GHC.Types.Var.html#tyVarKind"><span class="hs-identifier hs-var">tyVarKind</span></a></span><span> </span><span class="annot"><span class="annottext">TyCoVar
</span><a href="#local-6989586621680847725"><span class="hs-identifier hs-var">tv</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">FV -&gt; FV -&gt; FV
</span><a href="GHC.Utils.FV.html#unionFV"><span class="hs-operator hs-var">`unionFV`</span></a></span><span> </span><span class="annot"><span class="annottext">TyCoVar -&gt; FV -&gt; FV
</span><a href="GHC.Utils.FV.html#delFV"><span class="hs-identifier hs-var">delFV</span></a></span><span> </span><span class="annot"><span class="annottext">TyCoVar
</span><a href="#local-6989586621680847725"><span class="hs-identifier hs-var">tv</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Type -&gt; FV
</span><a href="#local-6989586621680847742"><span class="hs-identifier hs-var">go</span></a></span><span> </span><span class="annot"><span class="annottext">Type
</span><a href="#local-6989586621680847724"><span class="hs-identifier hs-var">ty</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-805"></span><span>    </span><span class="annot"><a href="#local-6989586621680847742"><span class="hs-identifier hs-var">go</span></a></span><span> </span><span class="annot"><a href="GHC.Core.TyCo.Rep.html#LitTy"><span class="hs-identifier hs-type">LitTy</span></a></span><span class="hs-special">{</span><span class="hs-special">}</span><span>                   </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">FV
</span><a href="GHC.Utils.FV.html#emptyFV"><span class="hs-identifier hs-var">emptyFV</span></a></span><span>
</span><span id="line-806"></span><span>    </span><span class="annot"><a href="#local-6989586621680847742"><span class="hs-identifier hs-var">go</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Core.TyCo.Rep.html#CastTy"><span class="hs-identifier hs-type">CastTy</span></a></span><span> </span><span id="local-6989586621680847723"><span class="annot"><span class="annottext">Type
</span><a href="#local-6989586621680847723"><span class="hs-identifier hs-var">ty</span></a></span></span><span> </span><span class="annot"><span class="annottext">Coercion
</span><span class="hs-identifier">_</span></span><span class="hs-special">)</span><span>             </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Type -&gt; FV
</span><a href="#local-6989586621680847742"><span class="hs-identifier hs-var">go</span></a></span><span> </span><span class="annot"><span class="annottext">Type
</span><a href="#local-6989586621680847723"><span class="hs-identifier hs-var">ty</span></a></span><span>
</span><span id="line-807"></span><span>    </span><span class="annot"><a href="#local-6989586621680847742"><span class="hs-identifier hs-var">go</span></a></span><span> </span><span class="annot"><a href="GHC.Core.TyCo.Rep.html#CoercionTy"><span class="hs-identifier hs-type">CoercionTy</span></a></span><span class="hs-special">{</span><span class="hs-special">}</span><span>              </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">FV
</span><a href="GHC.Utils.FV.html#emptyFV"><span class="hs-identifier hs-var">emptyFV</span></a></span><span>
</span><span id="line-808"></span><span>
</span><span id="line-809"></span><span class="hs-comment">-- | Returns the free variables of a 'Type' that are in injective positions.</span><span>
</span><span id="line-810"></span><span class="hs-comment">-- Specifically, it finds the free variables while:</span><span>
</span><span id="line-811"></span><span class="hs-comment">--</span><span>
</span><span id="line-812"></span><span class="hs-comment">-- * Expanding type synonyms</span><span>
</span><span id="line-813"></span><span class="hs-comment">--</span><span>
</span><span id="line-814"></span><span class="hs-comment">-- * Ignoring the coercion in @(ty |&gt; co)@</span><span>
</span><span id="line-815"></span><span class="hs-comment">--</span><span>
</span><span id="line-816"></span><span class="hs-comment">-- * Ignoring the non-injective fields of a 'TyConApp'</span><span>
</span><span id="line-817"></span><span class="hs-comment">--</span><span>
</span><span id="line-818"></span><span class="hs-comment">-- See @Note [When does a tycon application need an explicit kind signature?]@.</span><span>
</span><span id="line-819"></span><span class="annot"><a href="GHC.Core.TyCo.FVs.html#injectiveVarsOfTypes"><span class="hs-identifier hs-type">injectiveVarsOfTypes</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><span class="hs-identifier hs-type">Bool</span></span><span> </span><span class="hs-comment">-- ^ look under injective type families?</span><span>
</span><span id="line-820"></span><span>                             </span><span class="hs-comment">-- See Note [Coverage condition for injective type families]</span><span>
</span><span id="line-821"></span><span>                             </span><span class="hs-comment">-- in &quot;GHC.Tc.Instance.Family&quot;.</span><span>
</span><span id="line-822"></span><span>                     </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">[</span><span class="annot"><a href="GHC.Core.TyCo.Rep.html#Type"><span class="hs-identifier hs-type">Type</span></a></span><span class="hs-special">]</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Utils.FV.html#FV"><span class="hs-identifier hs-type">FV</span></a></span><span>
</span><span id="line-823"></span><span id="injectiveVarsOfTypes"><span class="annot"><span class="annottext">injectiveVarsOfTypes :: Bool -&gt; [Type] -&gt; FV
</span><a href="GHC.Core.TyCo.FVs.html#injectiveVarsOfTypes"><span class="hs-identifier hs-var hs-var">injectiveVarsOfTypes</span></a></span></span><span> </span><span id="local-6989586621680847722"><span class="annot"><span class="annottext">Bool
</span><a href="#local-6989586621680847722"><span class="hs-identifier hs-var">look_under_tfs</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">(Type -&gt; FV) -&gt; [Type] -&gt; FV
forall a. (a -&gt; FV) -&gt; [a] -&gt; FV
</span><a href="GHC.Utils.FV.html#mapUnionFV"><span class="hs-identifier hs-var">mapUnionFV</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Bool -&gt; Type -&gt; FV
</span><a href="GHC.Core.TyCo.FVs.html#injectiveVarsOfType"><span class="hs-identifier hs-var">injectiveVarsOfType</span></a></span><span> </span><span class="annot"><span class="annottext">Bool
</span><a href="#local-6989586621680847722"><span class="hs-identifier hs-var">look_under_tfs</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-824"></span><span>
</span><span id="line-825"></span><span>
</span><span id="line-826"></span><span class="hs-comment">{- *********************************************************************
*                                                                      *
                 Invisible vars
*                                                                      *
********************************************************************* -}</span><span>
</span><span id="line-831"></span><span>
</span><span id="line-832"></span><span>
</span><span id="line-833"></span><span class="hs-comment">-- | Returns the set of variables that are used invisibly anywhere within</span><span>
</span><span id="line-834"></span><span class="hs-comment">-- the given type. A variable will be included even if it is used both visibly</span><span>
</span><span id="line-835"></span><span class="hs-comment">-- and invisibly. An invisible use site includes:</span><span>
</span><span id="line-836"></span><span class="hs-comment">--   * In the kind of a variable</span><span>
</span><span id="line-837"></span><span class="hs-comment">--   * In the kind of a bound variable in a forall</span><span>
</span><span id="line-838"></span><span class="hs-comment">--   * In a coercion</span><span>
</span><span id="line-839"></span><span class="hs-comment">--   * In a Specified or Inferred argument to a function</span><span>
</span><span id="line-840"></span><span class="hs-comment">-- See Note [VarBndrs, TyCoVarBinders, TyConBinders, and visibility] in &quot;GHC.Core.TyCo.Rep&quot;</span><span>
</span><span id="line-841"></span><span class="annot"><a href="GHC.Core.TyCo.FVs.html#invisibleVarsOfType"><span class="hs-identifier hs-type">invisibleVarsOfType</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Core.TyCo.Rep.html#Type"><span class="hs-identifier hs-type">Type</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Utils.FV.html#FV"><span class="hs-identifier hs-type">FV</span></a></span><span>
</span><span id="line-842"></span><span id="invisibleVarsOfType"><span class="annot"><span class="annottext">invisibleVarsOfType :: Type -&gt; FV
</span><a href="GHC.Core.TyCo.FVs.html#invisibleVarsOfType"><span class="hs-identifier hs-var hs-var">invisibleVarsOfType</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Type -&gt; FV
</span><a href="#local-6989586621680847721"><span class="hs-identifier hs-var">go</span></a></span><span>
</span><span id="line-843"></span><span>  </span><span class="hs-keyword">where</span><span>
</span><span id="line-844"></span><span>    </span><span id="local-6989586621680847721"><span class="annot"><span class="annottext">go :: Type -&gt; FV
</span><a href="#local-6989586621680847721"><span class="hs-identifier hs-var hs-var">go</span></a></span></span><span> </span><span id="local-6989586621680847720"><span class="annot"><span class="annottext">Type
</span><a href="#local-6989586621680847720"><span class="hs-identifier hs-var">ty</span></a></span></span><span>                 </span><span class="hs-glyph">|</span><span> </span><span class="annot"><a href="../../base/src/GHC.Maybe.html#Just"><span class="hs-identifier hs-type">Just</span></a></span><span> </span><span id="local-6989586621680847719"><span class="annot"><span class="annottext">Type
</span><a href="#local-6989586621680847719"><span class="hs-identifier hs-var">ty'</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">Type -&gt; Maybe Type
</span><a href="GHC.Core.Type.html#coreView"><span class="hs-identifier hs-var">coreView</span></a></span><span> </span><span class="annot"><span class="annottext">Type
</span><a href="#local-6989586621680847720"><span class="hs-identifier hs-var">ty</span></a></span><span>
</span><span id="line-845"></span><span>                          </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Type -&gt; FV
</span><a href="#local-6989586621680847721"><span class="hs-identifier hs-var">go</span></a></span><span> </span><span class="annot"><span class="annottext">Type
</span><a href="#local-6989586621680847719"><span class="hs-identifier hs-var">ty'</span></a></span><span>
</span><span id="line-846"></span><span>    </span><span class="annot"><a href="#local-6989586621680847721"><span class="hs-identifier hs-var">go</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Core.TyCo.Rep.html#TyVarTy"><span class="hs-identifier hs-type">TyVarTy</span></a></span><span> </span><span id="local-6989586621680847718"><span class="annot"><span class="annottext">TyCoVar
</span><a href="#local-6989586621680847718"><span class="hs-identifier hs-var">v</span></a></span></span><span class="hs-special">)</span><span>        </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Type -&gt; FV
</span><a href="#local-6989586621680847721"><span class="hs-identifier hs-var">go</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">TyCoVar -&gt; Type
</span><a href="GHC.Types.Var.html#tyVarKind"><span class="hs-identifier hs-var">tyVarKind</span></a></span><span> </span><span class="annot"><span class="annottext">TyCoVar
</span><a href="#local-6989586621680847718"><span class="hs-identifier hs-var">v</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-847"></span><span>    </span><span class="annot"><a href="#local-6989586621680847721"><span class="hs-identifier hs-var">go</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Core.TyCo.Rep.html#AppTy"><span class="hs-identifier hs-type">AppTy</span></a></span><span> </span><span id="local-6989586621680847717"><span class="annot"><span class="annottext">Type
</span><a href="#local-6989586621680847717"><span class="hs-identifier hs-var">f</span></a></span></span><span> </span><span id="local-6989586621680847716"><span class="annot"><span class="annottext">Type
</span><a href="#local-6989586621680847716"><span class="hs-identifier hs-var">a</span></a></span></span><span class="hs-special">)</span><span>        </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Type -&gt; FV
</span><a href="#local-6989586621680847721"><span class="hs-identifier hs-var">go</span></a></span><span> </span><span class="annot"><span class="annottext">Type
</span><a href="#local-6989586621680847717"><span class="hs-identifier hs-var">f</span></a></span><span> </span><span class="annot"><span class="annottext">FV -&gt; FV -&gt; FV
</span><a href="GHC.Utils.FV.html#unionFV"><span class="hs-operator hs-var">`unionFV`</span></a></span><span> </span><span class="annot"><span class="annottext">Type -&gt; FV
</span><a href="#local-6989586621680847721"><span class="hs-identifier hs-var">go</span></a></span><span> </span><span class="annot"><span class="annottext">Type
</span><a href="#local-6989586621680847716"><span class="hs-identifier hs-var">a</span></a></span><span>
</span><span id="line-848"></span><span>    </span><span class="annot"><a href="#local-6989586621680847721"><span class="hs-identifier hs-var">go</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Core.TyCo.Rep.html#FunTy"><span class="hs-identifier hs-type">FunTy</span></a></span><span> </span><span class="annot"><span class="annottext">AnonArgFlag
</span><span class="hs-identifier">_</span></span><span> </span><span id="local-6989586621680847715"><span class="annot"><span class="annottext">Type
</span><a href="#local-6989586621680847715"><span class="hs-identifier hs-var">w</span></a></span></span><span> </span><span id="local-6989586621680847714"><span class="annot"><span class="annottext">Type
</span><a href="#local-6989586621680847714"><span class="hs-identifier hs-var">ty1</span></a></span></span><span> </span><span id="local-6989586621680847713"><span class="annot"><span class="annottext">Type
</span><a href="#local-6989586621680847713"><span class="hs-identifier hs-var">ty2</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Type -&gt; FV
</span><a href="#local-6989586621680847721"><span class="hs-identifier hs-var">go</span></a></span><span> </span><span class="annot"><span class="annottext">Type
</span><a href="#local-6989586621680847715"><span class="hs-identifier hs-var">w</span></a></span><span> </span><span class="annot"><span class="annottext">FV -&gt; FV -&gt; FV
</span><a href="GHC.Utils.FV.html#unionFV"><span class="hs-operator hs-var">`unionFV`</span></a></span><span> </span><span class="annot"><span class="annottext">Type -&gt; FV
</span><a href="#local-6989586621680847721"><span class="hs-identifier hs-var">go</span></a></span><span> </span><span class="annot"><span class="annottext">Type
</span><a href="#local-6989586621680847714"><span class="hs-identifier hs-var">ty1</span></a></span><span> </span><span class="annot"><span class="annottext">FV -&gt; FV -&gt; FV
</span><a href="GHC.Utils.FV.html#unionFV"><span class="hs-operator hs-var">`unionFV`</span></a></span><span> </span><span class="annot"><span class="annottext">Type -&gt; FV
</span><a href="#local-6989586621680847721"><span class="hs-identifier hs-var">go</span></a></span><span> </span><span class="annot"><span class="annottext">Type
</span><a href="#local-6989586621680847713"><span class="hs-identifier hs-var">ty2</span></a></span><span>
</span><span id="line-849"></span><span>    </span><span class="annot"><a href="#local-6989586621680847721"><span class="hs-identifier hs-var">go</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Core.TyCo.Rep.html#TyConApp"><span class="hs-identifier hs-type">TyConApp</span></a></span><span> </span><span id="local-6989586621680847712"><span class="annot"><span class="annottext">TyCon
</span><a href="#local-6989586621680847712"><span class="hs-identifier hs-var">tc</span></a></span></span><span> </span><span id="local-6989586621680847711"><span class="annot"><span class="annottext">[Type]
</span><a href="#local-6989586621680847711"><span class="hs-identifier hs-var">tys</span></a></span></span><span class="hs-special">)</span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">[Type] -&gt; FV
</span><a href="GHC.Core.TyCo.FVs.html#tyCoFVsOfTypes"><span class="hs-identifier hs-var">tyCoFVsOfTypes</span></a></span><span> </span><span class="annot"><span class="annottext">[Type]
</span><a href="#local-6989586621680847710"><span class="hs-identifier hs-var">invisibles</span></a></span><span> </span><span class="annot"><span class="annottext">FV -&gt; FV -&gt; FV
</span><a href="GHC.Utils.FV.html#unionFV"><span class="hs-operator hs-var">`unionFV`</span></a></span><span>
</span><span id="line-850"></span><span>                            </span><span class="annot"><span class="annottext">[Type] -&gt; FV
</span><a href="GHC.Core.TyCo.FVs.html#invisibleVarsOfTypes"><span class="hs-identifier hs-var">invisibleVarsOfTypes</span></a></span><span> </span><span class="annot"><span class="annottext">[Type]
</span><a href="#local-6989586621680847709"><span class="hs-identifier hs-var">visibles</span></a></span><span>
</span><span id="line-851"></span><span>      </span><span class="hs-keyword">where</span><span> </span><span class="hs-special">(</span><span id="local-6989586621680847710"><span class="annot"><span class="annottext">[Type]
</span><a href="#local-6989586621680847710"><span class="hs-identifier hs-var">invisibles</span></a></span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621680847709"><span class="annot"><span class="annottext">[Type]
</span><a href="#local-6989586621680847709"><span class="hs-identifier hs-var">visibles</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">TyCon -&gt; [Type] -&gt; ([Type], [Type])
</span><a href="GHC.Core.Type.html#partitionInvisibleTypes"><span class="hs-identifier hs-var">partitionInvisibleTypes</span></a></span><span> </span><span class="annot"><span class="annottext">TyCon
</span><a href="#local-6989586621680847712"><span class="hs-identifier hs-var">tc</span></a></span><span> </span><span class="annot"><span class="annottext">[Type]
</span><a href="#local-6989586621680847711"><span class="hs-identifier hs-var">tys</span></a></span><span>
</span><span id="line-852"></span><span>    </span><span class="annot"><a href="#local-6989586621680847721"><span class="hs-identifier hs-var">go</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Core.TyCo.Rep.html#ForAllTy"><span class="hs-identifier hs-type">ForAllTy</span></a></span><span> </span><span id="local-6989586621680847708"><span class="annot"><span class="annottext">TyCoVarBinder
</span><a href="#local-6989586621680847708"><span class="hs-identifier hs-var">tvb</span></a></span></span><span> </span><span id="local-6989586621680847707"><span class="annot"><span class="annottext">Type
</span><a href="#local-6989586621680847707"><span class="hs-identifier hs-var">ty</span></a></span></span><span class="hs-special">)</span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">TyCoVarBinder -&gt; FV -&gt; FV
</span><a href="GHC.Core.TyCo.FVs.html#tyCoFVsBndr"><span class="hs-identifier hs-var">tyCoFVsBndr</span></a></span><span> </span><span class="annot"><span class="annottext">TyCoVarBinder
</span><a href="#local-6989586621680847708"><span class="hs-identifier hs-var">tvb</span></a></span><span> </span><span class="annot"><span class="annottext">(FV -&gt; FV) -&gt; FV -&gt; FV
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="annot"><span class="annottext">Type -&gt; FV
</span><a href="#local-6989586621680847721"><span class="hs-identifier hs-var">go</span></a></span><span> </span><span class="annot"><span class="annottext">Type
</span><a href="#local-6989586621680847707"><span class="hs-identifier hs-var">ty</span></a></span><span>
</span><span id="line-853"></span><span>    </span><span class="annot"><a href="#local-6989586621680847721"><span class="hs-identifier hs-var">go</span></a></span><span> </span><span class="annot"><a href="GHC.Core.TyCo.Rep.html#LitTy"><span class="hs-identifier hs-type">LitTy</span></a></span><span class="hs-special">{</span><span class="hs-special">}</span><span>            </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">FV
</span><a href="GHC.Utils.FV.html#emptyFV"><span class="hs-identifier hs-var">emptyFV</span></a></span><span>
</span><span id="line-854"></span><span>    </span><span class="annot"><a href="#local-6989586621680847721"><span class="hs-identifier hs-var">go</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Core.TyCo.Rep.html#CastTy"><span class="hs-identifier hs-type">CastTy</span></a></span><span> </span><span id="local-6989586621680847706"><span class="annot"><span class="annottext">Type
</span><a href="#local-6989586621680847706"><span class="hs-identifier hs-var">ty</span></a></span></span><span> </span><span id="local-6989586621680847705"><span class="annot"><span class="annottext">Coercion
</span><a href="#local-6989586621680847705"><span class="hs-identifier hs-var">co</span></a></span></span><span class="hs-special">)</span><span>     </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Coercion -&gt; FV
</span><a href="GHC.Core.TyCo.FVs.html#tyCoFVsOfCo"><span class="hs-identifier hs-var">tyCoFVsOfCo</span></a></span><span> </span><span class="annot"><span class="annottext">Coercion
</span><a href="#local-6989586621680847705"><span class="hs-identifier hs-var">co</span></a></span><span> </span><span class="annot"><span class="annottext">FV -&gt; FV -&gt; FV
</span><a href="GHC.Utils.FV.html#unionFV"><span class="hs-operator hs-var">`unionFV`</span></a></span><span> </span><span class="annot"><span class="annottext">Type -&gt; FV
</span><a href="#local-6989586621680847721"><span class="hs-identifier hs-var">go</span></a></span><span> </span><span class="annot"><span class="annottext">Type
</span><a href="#local-6989586621680847706"><span class="hs-identifier hs-var">ty</span></a></span><span>
</span><span id="line-855"></span><span>    </span><span class="annot"><a href="#local-6989586621680847721"><span class="hs-identifier hs-var">go</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Core.TyCo.Rep.html#CoercionTy"><span class="hs-identifier hs-type">CoercionTy</span></a></span><span> </span><span id="local-6989586621680847704"><span class="annot"><span class="annottext">Coercion
</span><a href="#local-6989586621680847704"><span class="hs-identifier hs-var">co</span></a></span></span><span class="hs-special">)</span><span>    </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Coercion -&gt; FV
</span><a href="GHC.Core.TyCo.FVs.html#tyCoFVsOfCo"><span class="hs-identifier hs-var">tyCoFVsOfCo</span></a></span><span> </span><span class="annot"><span class="annottext">Coercion
</span><a href="#local-6989586621680847704"><span class="hs-identifier hs-var">co</span></a></span><span>
</span><span id="line-856"></span><span>
</span><span id="line-857"></span><span class="hs-comment">-- | Like 'invisibleVarsOfType', but for many types.</span><span>
</span><span id="line-858"></span><span class="annot"><a href="GHC.Core.TyCo.FVs.html#invisibleVarsOfTypes"><span class="hs-identifier hs-type">invisibleVarsOfTypes</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="hs-special">[</span><span class="annot"><a href="GHC.Core.TyCo.Rep.html#Type"><span class="hs-identifier hs-type">Type</span></a></span><span class="hs-special">]</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Utils.FV.html#FV"><span class="hs-identifier hs-type">FV</span></a></span><span>
</span><span id="line-859"></span><span id="invisibleVarsOfTypes"><span class="annot"><span class="annottext">invisibleVarsOfTypes :: [Type] -&gt; FV
</span><a href="GHC.Core.TyCo.FVs.html#invisibleVarsOfTypes"><span class="hs-identifier hs-var hs-var">invisibleVarsOfTypes</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">(Type -&gt; FV) -&gt; [Type] -&gt; FV
forall a. (a -&gt; FV) -&gt; [a] -&gt; FV
</span><a href="GHC.Utils.FV.html#mapUnionFV"><span class="hs-identifier hs-var">mapUnionFV</span></a></span><span> </span><span class="annot"><span class="annottext">Type -&gt; FV
</span><a href="GHC.Core.TyCo.FVs.html#invisibleVarsOfType"><span class="hs-identifier hs-var">invisibleVarsOfType</span></a></span><span>
</span><span id="line-860"></span><span>
</span><span id="line-861"></span><span>
</span><span id="line-862"></span><span class="hs-comment">{- *********************************************************************
*                                                                      *
                 No free vars
*                                                                      *
********************************************************************* -}</span><span>
</span><span id="line-867"></span><span>
</span><span id="line-868"></span><span class="annot"><a href="GHC.Core.TyCo.FVs.html#nfvFolder"><span class="hs-identifier hs-type">nfvFolder</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Core.TyCo.Rep.html#TyCoFolder"><span class="hs-identifier hs-type">TyCoFolder</span></a></span><span> </span><span class="annot"><a href="GHC.Types.Var.Set.html#TyCoVarSet"><span class="hs-identifier hs-type">TyCoVarSet</span></a></span><span> </span><span class="annot"><a href="../../base/src/Data.Semigroup.Internal.html#All"><span class="hs-identifier hs-type">DM.All</span></a></span><span>
</span><span id="line-869"></span><span id="nfvFolder"><span class="annot"><span class="annottext">nfvFolder :: TyCoFolder VarSet All
</span><a href="GHC.Core.TyCo.FVs.html#nfvFolder"><span class="hs-identifier hs-var hs-var">nfvFolder</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">TyCoFolder :: forall env a.
(Type -&gt; Maybe Type)
-&gt; (env -&gt; TyCoVar -&gt; a)
-&gt; (env -&gt; TyCoVar -&gt; a)
-&gt; (env -&gt; CoercionHole -&gt; a)
-&gt; (env -&gt; TyCoVar -&gt; ArgFlag -&gt; env)
-&gt; TyCoFolder env a
</span><a href="GHC.Core.TyCo.Rep.html#TyCoFolder"><span class="hs-identifier hs-type">TyCoFolder</span></a></span><span> </span><span class="hs-special">{</span><span> </span><span class="annot"><span class="annottext">tcf_view :: Type -&gt; Maybe Type
</span><a href="GHC.Core.TyCo.Rep.html#tcf_view"><span class="hs-identifier hs-var">tcf_view</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Type -&gt; Maybe Type
</span><a href="GHC.Core.TyCo.FVs.html#noView"><span class="hs-identifier hs-var">noView</span></a></span><span>
</span><span id="line-870"></span><span>                       </span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">tcf_tyvar :: VarSet -&gt; TyCoVar -&gt; All
</span><a href="GHC.Core.TyCo.Rep.html#tcf_tyvar"><span class="hs-identifier hs-var">tcf_tyvar</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">VarSet -&gt; TyCoVar -&gt; All
</span><a href="#local-6989586621680847702"><span class="hs-identifier hs-var">do_tcv</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">tcf_covar :: VarSet -&gt; TyCoVar -&gt; All
</span><a href="GHC.Core.TyCo.Rep.html#tcf_covar"><span class="hs-identifier hs-var">tcf_covar</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">VarSet -&gt; TyCoVar -&gt; All
</span><a href="#local-6989586621680847702"><span class="hs-identifier hs-var">do_tcv</span></a></span><span>
</span><span id="line-871"></span><span>                       </span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">tcf_hole :: VarSet -&gt; CoercionHole -&gt; All
</span><a href="GHC.Core.TyCo.Rep.html#tcf_hole"><span class="hs-identifier hs-var">tcf_hole</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">VarSet -&gt; CoercionHole -&gt; All
forall {p} {p}. p -&gt; p -&gt; All
</span><a href="#local-6989586621680847701"><span class="hs-identifier hs-var">do_hole</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">tcf_tycobinder :: VarSet -&gt; TyCoVar -&gt; ArgFlag -&gt; VarSet
</span><a href="GHC.Core.TyCo.Rep.html#tcf_tycobinder"><span class="hs-identifier hs-var">tcf_tycobinder</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">VarSet -&gt; TyCoVar -&gt; ArgFlag -&gt; VarSet
forall {p}. VarSet -&gt; TyCoVar -&gt; p -&gt; VarSet
</span><a href="#local-6989586621680847700"><span class="hs-identifier hs-var">do_bndr</span></a></span><span> </span><span class="hs-special">}</span><span>
</span><span id="line-872"></span><span>  </span><span class="hs-keyword">where</span><span>
</span><span id="line-873"></span><span>    </span><span id="local-6989586621680847702"><span class="annot"><span class="annottext">do_tcv :: VarSet -&gt; TyCoVar -&gt; All
</span><a href="#local-6989586621680847702"><span class="hs-identifier hs-var hs-var">do_tcv</span></a></span></span><span> </span><span id="local-6989586621680847699"><span class="annot"><span class="annottext">VarSet
</span><a href="#local-6989586621680847699"><span class="hs-identifier hs-var">is</span></a></span></span><span> </span><span id="local-6989586621680847698"><span class="annot"><span class="annottext">TyCoVar
</span><a href="#local-6989586621680847698"><span class="hs-identifier hs-var">tv</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Bool -&gt; All
</span><a href="../../base/src/Data.Semigroup.Internal.html#All"><span class="hs-identifier hs-var">All</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">TyCoVar
</span><a href="#local-6989586621680847698"><span class="hs-identifier hs-var">tv</span></a></span><span> </span><span class="annot"><span class="annottext">TyCoVar -&gt; VarSet -&gt; Bool
</span><a href="GHC.Types.Var.Set.html#elemVarSet"><span class="hs-operator hs-var">`elemVarSet`</span></a></span><span> </span><span class="annot"><span class="annottext">VarSet
</span><a href="#local-6989586621680847699"><span class="hs-identifier hs-var">is</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-874"></span><span>    </span><span id="local-6989586621680847701"><span class="annot"><span class="annottext">do_hole :: p -&gt; p -&gt; All
</span><a href="#local-6989586621680847701"><span class="hs-identifier hs-var hs-var">do_hole</span></a></span></span><span> </span><span class="annot"><span class="annottext">p
</span><span class="hs-identifier">_</span></span><span> </span><span class="annot"><span class="annottext">p
</span><span class="hs-identifier">_</span></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Bool -&gt; All
</span><a href="../../base/src/Data.Semigroup.Internal.html#All"><span class="hs-identifier hs-var">All</span></a></span><span> </span><span class="annot"><span class="annottext">Bool
</span><span class="hs-identifier hs-var">True</span></span><span>    </span><span class="hs-comment">-- I'm unsure; probably never happens</span><span>
</span><span id="line-875"></span><span>    </span><span id="local-6989586621680847700"><span class="annot"><span class="annottext">do_bndr :: VarSet -&gt; TyCoVar -&gt; p -&gt; VarSet
</span><a href="#local-6989586621680847700"><span class="hs-identifier hs-var hs-var">do_bndr</span></a></span></span><span> </span><span id="local-6989586621680847696"><span class="annot"><span class="annottext">VarSet
</span><a href="#local-6989586621680847696"><span class="hs-identifier hs-var">is</span></a></span></span><span> </span><span id="local-6989586621680847695"><span class="annot"><span class="annottext">TyCoVar
</span><a href="#local-6989586621680847695"><span class="hs-identifier hs-var">tv</span></a></span></span><span> </span><span class="annot"><span class="annottext">p
</span><span class="hs-identifier">_</span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">VarSet
</span><a href="#local-6989586621680847696"><span class="hs-identifier hs-var">is</span></a></span><span> </span><span class="annot"><span class="annottext">VarSet -&gt; TyCoVar -&gt; VarSet
</span><a href="GHC.Types.Var.Set.html#extendVarSet"><span class="hs-operator hs-var">`extendVarSet`</span></a></span><span> </span><span class="annot"><span class="annottext">TyCoVar
</span><a href="#local-6989586621680847695"><span class="hs-identifier hs-var">tv</span></a></span><span>
</span><span id="line-876"></span><span>
</span><span id="line-877"></span><span class="annot"><a href="GHC.Core.TyCo.FVs.html#nfv_ty"><span class="hs-identifier hs-type">nfv_ty</span></a></span><span>  </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Core.TyCo.Rep.html#Type"><span class="hs-identifier hs-type">Type</span></a></span><span>       </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="../../base/src/Data.Semigroup.Internal.html#All"><span class="hs-identifier hs-type">DM.All</span></a></span><span>
</span><span id="line-878"></span><span class="annot"><a href="GHC.Core.TyCo.FVs.html#nfv_tys"><span class="hs-identifier hs-type">nfv_tys</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="hs-special">[</span><span class="annot"><a href="GHC.Core.TyCo.Rep.html#Type"><span class="hs-identifier hs-type">Type</span></a></span><span class="hs-special">]</span><span>     </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="../../base/src/Data.Semigroup.Internal.html#All"><span class="hs-identifier hs-type">DM.All</span></a></span><span>
</span><span id="line-879"></span><span class="annot"><a href="GHC.Core.TyCo.FVs.html#nfv_co"><span class="hs-identifier hs-type">nfv_co</span></a></span><span>  </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Core.TyCo.Rep.html#Coercion"><span class="hs-identifier hs-type">Coercion</span></a></span><span>   </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="../../base/src/Data.Semigroup.Internal.html#All"><span class="hs-identifier hs-type">DM.All</span></a></span><span>
</span><span id="line-880"></span><span class="hs-special">(</span><span id="nfv_ty"><span class="annot"><span class="annottext">Type -&gt; All
</span><a href="GHC.Core.TyCo.FVs.html#nfv_ty"><span class="hs-identifier hs-var">nfv_ty</span></a></span></span><span class="hs-special">,</span><span> </span><span id="nfv_tys"><span class="annot"><span class="annottext">[Type] -&gt; All
</span><a href="GHC.Core.TyCo.FVs.html#nfv_tys"><span class="hs-identifier hs-var">nfv_tys</span></a></span></span><span class="hs-special">,</span><span> </span><span id="nfv_co"><span class="annot"><span class="annottext">Coercion -&gt; All
</span><a href="GHC.Core.TyCo.FVs.html#nfv_co"><span class="hs-identifier hs-var">nfv_co</span></a></span></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">[Coercion] -&gt; All
</span><span class="hs-identifier">_</span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">TyCoFolder VarSet All
-&gt; VarSet
-&gt; (Type -&gt; All, [Type] -&gt; All, Coercion -&gt; All, [Coercion] -&gt; All)
forall a env.
Monoid a =&gt;
TyCoFolder env a
-&gt; env -&gt; (Type -&gt; a, [Type] -&gt; a, Coercion -&gt; a, [Coercion] -&gt; a)
</span><a href="GHC.Core.TyCo.Rep.html#foldTyCo"><span class="hs-identifier hs-var">foldTyCo</span></a></span><span> </span><span class="annot"><span class="annottext">TyCoFolder VarSet All
</span><a href="GHC.Core.TyCo.FVs.html#nfvFolder"><span class="hs-identifier hs-var">nfvFolder</span></a></span><span> </span><span class="annot"><span class="annottext">VarSet
</span><a href="GHC.Types.Var.Set.html#emptyVarSet"><span class="hs-identifier hs-var">emptyVarSet</span></a></span><span>
</span><span id="line-881"></span><span>
</span><span id="line-882"></span><span class="annot"><a href="GHC.Core.TyCo.FVs.html#noFreeVarsOfType"><span class="hs-identifier hs-type">noFreeVarsOfType</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Core.TyCo.Rep.html#Type"><span class="hs-identifier hs-type">Type</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="hs-identifier hs-type">Bool</span></span><span>
</span><span id="line-883"></span><span id="noFreeVarsOfType"><span class="annot"><span class="annottext">noFreeVarsOfType :: Type -&gt; Bool
</span><a href="GHC.Core.TyCo.FVs.html#noFreeVarsOfType"><span class="hs-identifier hs-var hs-var">noFreeVarsOfType</span></a></span></span><span> </span><span id="local-6989586621680847689"><span class="annot"><span class="annottext">Type
</span><a href="#local-6989586621680847689"><span class="hs-identifier hs-var">ty</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">All -&gt; Bool
</span><a href="../../base/src/Data.Semigroup.Internal.html#getAll"><span class="hs-identifier hs-var hs-var">DM.getAll</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Type -&gt; All
</span><a href="GHC.Core.TyCo.FVs.html#nfv_ty"><span class="hs-identifier hs-var">nfv_ty</span></a></span><span> </span><span class="annot"><span class="annottext">Type
</span><a href="#local-6989586621680847689"><span class="hs-identifier hs-var">ty</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-884"></span><span>
</span><span id="line-885"></span><span class="annot"><a href="GHC.Core.TyCo.FVs.html#noFreeVarsOfTypes"><span class="hs-identifier hs-type">noFreeVarsOfTypes</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="hs-special">[</span><span class="annot"><a href="GHC.Core.TyCo.Rep.html#Type"><span class="hs-identifier hs-type">Type</span></a></span><span class="hs-special">]</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="hs-identifier hs-type">Bool</span></span><span>
</span><span id="line-886"></span><span id="noFreeVarsOfTypes"><span class="annot"><span class="annottext">noFreeVarsOfTypes :: [Type] -&gt; Bool
</span><a href="GHC.Core.TyCo.FVs.html#noFreeVarsOfTypes"><span class="hs-identifier hs-var hs-var">noFreeVarsOfTypes</span></a></span></span><span> </span><span id="local-6989586621680847687"><span class="annot"><span class="annottext">[Type]
</span><a href="#local-6989586621680847687"><span class="hs-identifier hs-var">tys</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">All -&gt; Bool
</span><a href="../../base/src/Data.Semigroup.Internal.html#getAll"><span class="hs-identifier hs-var hs-var">DM.getAll</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">[Type] -&gt; All
</span><a href="GHC.Core.TyCo.FVs.html#nfv_tys"><span class="hs-identifier hs-var">nfv_tys</span></a></span><span> </span><span class="annot"><span class="annottext">[Type]
</span><a href="#local-6989586621680847687"><span class="hs-identifier hs-var">tys</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-887"></span><span>
</span><span id="line-888"></span><span class="annot"><a href="GHC.Core.TyCo.FVs.html#noFreeVarsOfCo"><span class="hs-identifier hs-type">noFreeVarsOfCo</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Core.TyCo.Rep.html#Coercion"><span class="hs-identifier hs-type">Coercion</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="hs-identifier hs-type">Bool</span></span><span>
</span><span id="line-889"></span><span id="noFreeVarsOfCo"><span class="annot"><span class="annottext">noFreeVarsOfCo :: Coercion -&gt; Bool
</span><a href="GHC.Core.TyCo.FVs.html#noFreeVarsOfCo"><span class="hs-identifier hs-var hs-var">noFreeVarsOfCo</span></a></span></span><span> </span><span id="local-6989586621680847686"><span class="annot"><span class="annottext">Coercion
</span><a href="#local-6989586621680847686"><span class="hs-identifier hs-var">co</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">All -&gt; Bool
</span><a href="../../base/src/Data.Semigroup.Internal.html#getAll"><span class="hs-identifier hs-var hs-var">getAll</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Coercion -&gt; All
</span><a href="GHC.Core.TyCo.FVs.html#nfv_co"><span class="hs-identifier hs-var">nfv_co</span></a></span><span> </span><span class="annot"><span class="annottext">Coercion
</span><a href="#local-6989586621680847686"><span class="hs-identifier hs-var">co</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-890"></span><span>
</span><span id="line-891"></span><span>
</span><span id="line-892"></span><span class="hs-comment">{- *********************************************************************
*                                                                      *
                 scopedSort
*                                                                      *
********************************************************************* -}</span><span>
</span><span id="line-897"></span><span>
</span><span id="line-898"></span><span class="hs-comment">{- Note [ScopedSort]
~~~~~~~~~~~~~~~~~~~~
Consider

  foo :: Proxy a -&gt; Proxy (b :: k) -&gt; Proxy (a :: k2) -&gt; ()

This function type is implicitly generalised over [a, b, k, k2]. These
variables will be Specified; that is, they will be available for visible
type application. This is because they are written in the type signature
by the user.

However, we must ask: what order will they appear in? In cases without
dependency, this is easy: we just use the lexical left-to-right ordering
of first occurrence. With dependency, we cannot get off the hook so
easily.

We thus state:

 * These variables appear in the order as given by ScopedSort, where
   the input to ScopedSort is the left-to-right order of first occurrence.

Note that this applies only to *implicit* quantification, without a
`forall`. If the user writes a `forall`, then we just use the order given.

ScopedSort is defined thusly (as proposed in #15743):
  * Work left-to-right through the input list, with a cursor.
  * If variable v at the cursor is depended on by any earlier variable w,
    move v immediately before the leftmost such w.

INVARIANT: The prefix of variables before the cursor form a valid telescope.

Note that ScopedSort makes sense only after type inference is done and all
types/kinds are fully settled and zonked.

-}</span><span>
</span><span id="line-933"></span><span>
</span><span id="line-934"></span><span class="hs-comment">-- | Do a topological sort on a list of tyvars,</span><span>
</span><span id="line-935"></span><span class="hs-comment">--   so that binders occur before occurrences</span><span>
</span><span id="line-936"></span><span class="hs-comment">-- E.g. given  [ a::k, k::*, b::k ]</span><span>
</span><span id="line-937"></span><span class="hs-comment">-- it'll return a well-scoped list [ k::*, a::k, b::k ]</span><span>
</span><span id="line-938"></span><span class="hs-comment">--</span><span>
</span><span id="line-939"></span><span class="hs-comment">-- This is a deterministic sorting operation</span><span>
</span><span id="line-940"></span><span class="hs-comment">-- (that is, doesn't depend on Uniques).</span><span>
</span><span id="line-941"></span><span class="hs-comment">--</span><span>
</span><span id="line-942"></span><span class="hs-comment">-- It is also meant to be stable: that is, variables should not</span><span>
</span><span id="line-943"></span><span class="hs-comment">-- be reordered unnecessarily. This is specified in Note [ScopedSort]</span><span>
</span><span id="line-944"></span><span class="hs-comment">-- See also Note [Ordering of implicit variables] in &quot;GHC.Rename.HsType&quot;</span><span>
</span><span id="line-945"></span><span>
</span><span id="line-946"></span><span class="annot"><a href="GHC.Core.TyCo.FVs.html#scopedSort"><span class="hs-identifier hs-type">scopedSort</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="hs-special">[</span><span class="annot"><a href="GHC.Types.Var.html#TyCoVar"><span class="hs-identifier hs-type">TyCoVar</span></a></span><span class="hs-special">]</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">[</span><span class="annot"><a href="GHC.Types.Var.html#TyCoVar"><span class="hs-identifier hs-type">TyCoVar</span></a></span><span class="hs-special">]</span><span>
</span><span id="line-947"></span><span id="scopedSort"><span class="annot"><span class="annottext">scopedSort :: [TyCoVar] -&gt; [TyCoVar]
</span><a href="GHC.Core.TyCo.FVs.html#scopedSort"><span class="hs-identifier hs-var hs-var">scopedSort</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">[TyCoVar] -&gt; [VarSet] -&gt; [TyCoVar] -&gt; [TyCoVar]
</span><a href="#local-6989586621680847685"><span class="hs-identifier hs-var">go</span></a></span><span> </span><span class="hs-special">[</span><span class="hs-special">]</span><span> </span><span class="hs-special">[</span><span class="hs-special">]</span><span>
</span><span id="line-948"></span><span>  </span><span class="hs-keyword">where</span><span>
</span><span id="line-949"></span><span>    </span><span class="annot"><a href="#local-6989586621680847685"><span class="hs-identifier hs-type">go</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="hs-special">[</span><span class="annot"><a href="GHC.Types.Var.html#TyCoVar"><span class="hs-identifier hs-type">TyCoVar</span></a></span><span class="hs-special">]</span><span> </span><span class="hs-comment">-- already sorted, in reverse order</span><span>
</span><span id="line-950"></span><span>       </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">[</span><span class="annot"><a href="GHC.Types.Var.Set.html#TyCoVarSet"><span class="hs-identifier hs-type">TyCoVarSet</span></a></span><span class="hs-special">]</span><span> </span><span class="hs-comment">-- each set contains all the variables which must be placed</span><span>
</span><span id="line-951"></span><span>                       </span><span class="hs-comment">-- before the tv corresponding to the set; they are accumulations</span><span>
</span><span id="line-952"></span><span>                       </span><span class="hs-comment">-- of the fvs in the sorted tvs' kinds</span><span>
</span><span id="line-953"></span><span>
</span><span id="line-954"></span><span>                       </span><span class="hs-comment">-- This list is in 1-to-1 correspondence with the sorted tyvars</span><span>
</span><span id="line-955"></span><span>                       </span><span class="hs-comment">-- INVARIANT:</span><span>
</span><span id="line-956"></span><span>                       </span><span class="hs-comment">--   all (\tl -&gt; all (`subVarSet` head tl) (tail tl)) (tails fv_list)</span><span>
</span><span id="line-957"></span><span>                       </span><span class="hs-comment">-- That is, each set in the list is a superset of all later sets.</span><span>
</span><span id="line-958"></span><span>
</span><span id="line-959"></span><span>       </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">[</span><span class="annot"><a href="GHC.Types.Var.html#TyCoVar"><span class="hs-identifier hs-type">TyCoVar</span></a></span><span class="hs-special">]</span><span> </span><span class="hs-comment">-- yet to be sorted</span><span>
</span><span id="line-960"></span><span>       </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">[</span><span class="annot"><a href="GHC.Types.Var.html#TyCoVar"><span class="hs-identifier hs-type">TyCoVar</span></a></span><span class="hs-special">]</span><span>
</span><span id="line-961"></span><span>    </span><span id="local-6989586621680847685"><span class="annot"><span class="annottext">go :: [TyCoVar] -&gt; [VarSet] -&gt; [TyCoVar] -&gt; [TyCoVar]
</span><a href="#local-6989586621680847685"><span class="hs-identifier hs-var hs-var">go</span></a></span></span><span> </span><span id="local-6989586621680847684"><span class="annot"><span class="annottext">[TyCoVar]
</span><a href="#local-6989586621680847684"><span class="hs-identifier hs-var">acc</span></a></span></span><span> </span><span id="local-6989586621680847683"><span class="annot"><span class="annottext">[VarSet]
</span><a href="#local-6989586621680847683"><span class="hs-identifier hs-var">_fv_list</span></a></span></span><span> </span><span class="hs-special">[</span><span class="hs-special">]</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">[TyCoVar] -&gt; [TyCoVar]
forall a. [a] -&gt; [a]
</span><a href="../../base/src/GHC.List.html#reverse"><span class="hs-identifier hs-var">reverse</span></a></span><span> </span><span class="annot"><span class="annottext">[TyCoVar]
</span><a href="#local-6989586621680847684"><span class="hs-identifier hs-var">acc</span></a></span><span>
</span><span id="line-962"></span><span>    </span><span class="annot"><a href="#local-6989586621680847685"><span class="hs-identifier hs-var">go</span></a></span><span> </span><span id="local-6989586621680847681"><span class="annot"><span class="annottext">[TyCoVar]
</span><a href="#local-6989586621680847681"><span class="hs-identifier hs-var">acc</span></a></span></span><span>  </span><span id="local-6989586621680847680"><span class="annot"><span class="annottext">[VarSet]
</span><a href="#local-6989586621680847680"><span class="hs-identifier hs-var">fv_list</span></a></span></span><span> </span><span class="hs-special">(</span><span id="local-6989586621680847679"><span class="annot"><span class="annottext">TyCoVar
</span><a href="#local-6989586621680847679"><span class="hs-identifier hs-var">tv</span></a></span></span><span class="annot"><span class="hs-glyph hs-type">:</span></span><span id="local-6989586621680847678"><span class="annot"><span class="annottext">[TyCoVar]
</span><a href="#local-6989586621680847678"><span class="hs-identifier hs-var">tvs</span></a></span></span><span class="hs-special">)</span><span>
</span><span id="line-963"></span><span>      </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">[TyCoVar] -&gt; [VarSet] -&gt; [TyCoVar] -&gt; [TyCoVar]
</span><a href="#local-6989586621680847685"><span class="hs-identifier hs-var">go</span></a></span><span> </span><span class="annot"><span class="annottext">[TyCoVar]
</span><a href="#local-6989586621680847677"><span class="hs-identifier hs-var">acc'</span></a></span><span> </span><span class="annot"><span class="annottext">[VarSet]
</span><a href="#local-6989586621680847676"><span class="hs-identifier hs-var">fv_list'</span></a></span><span> </span><span class="annot"><span class="annottext">[TyCoVar]
</span><a href="#local-6989586621680847678"><span class="hs-identifier hs-var">tvs</span></a></span><span>
</span><span id="line-964"></span><span>      </span><span class="hs-keyword">where</span><span>
</span><span id="line-965"></span><span>        </span><span class="hs-special">(</span><span id="local-6989586621680847677"><span class="annot"><span class="annottext">[TyCoVar]
</span><a href="#local-6989586621680847677"><span class="hs-identifier hs-var">acc'</span></a></span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621680847676"><span class="annot"><span class="annottext">[VarSet]
</span><a href="#local-6989586621680847676"><span class="hs-identifier hs-var">fv_list'</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">TyCoVar -&gt; [TyCoVar] -&gt; [VarSet] -&gt; ([TyCoVar], [VarSet])
</span><a href="#local-6989586621680847675"><span class="hs-identifier hs-var">insert</span></a></span><span> </span><span class="annot"><span class="annottext">TyCoVar
</span><a href="#local-6989586621680847679"><span class="hs-identifier hs-var">tv</span></a></span><span> </span><span class="annot"><span class="annottext">[TyCoVar]
</span><a href="#local-6989586621680847681"><span class="hs-identifier hs-var">acc</span></a></span><span> </span><span class="annot"><span class="annottext">[VarSet]
</span><a href="#local-6989586621680847680"><span class="hs-identifier hs-var">fv_list</span></a></span><span>
</span><span id="line-966"></span><span>
</span><span id="line-967"></span><span>    </span><span class="annot"><a href="#local-6989586621680847675"><span class="hs-identifier hs-type">insert</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Types.Var.html#TyCoVar"><span class="hs-identifier hs-type">TyCoVar</span></a></span><span>       </span><span class="hs-comment">-- var to insert</span><span>
</span><span id="line-968"></span><span>           </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">[</span><span class="annot"><a href="GHC.Types.Var.html#TyCoVar"><span class="hs-identifier hs-type">TyCoVar</span></a></span><span class="hs-special">]</span><span>     </span><span class="hs-comment">-- sorted list, in reverse order</span><span>
</span><span id="line-969"></span><span>           </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">[</span><span class="annot"><a href="GHC.Types.Var.Set.html#TyCoVarSet"><span class="hs-identifier hs-type">TyCoVarSet</span></a></span><span class="hs-special">]</span><span>  </span><span class="hs-comment">-- list of fvs, as above</span><span>
</span><span id="line-970"></span><span>           </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">(</span><span class="hs-special">[</span><span class="annot"><a href="GHC.Types.Var.html#TyCoVar"><span class="hs-identifier hs-type">TyCoVar</span></a></span><span class="hs-special">]</span><span class="hs-special">,</span><span> </span><span class="hs-special">[</span><span class="annot"><a href="GHC.Types.Var.Set.html#TyCoVarSet"><span class="hs-identifier hs-type">TyCoVarSet</span></a></span><span class="hs-special">]</span><span class="hs-special">)</span><span>   </span><span class="hs-comment">-- augmented lists</span><span>
</span><span id="line-971"></span><span>    </span><span id="local-6989586621680847675"><span class="annot"><span class="annottext">insert :: TyCoVar -&gt; [TyCoVar] -&gt; [VarSet] -&gt; ([TyCoVar], [VarSet])
</span><a href="#local-6989586621680847675"><span class="hs-identifier hs-var hs-var">insert</span></a></span></span><span> </span><span id="local-6989586621680847674"><span class="annot"><span class="annottext">TyCoVar
</span><a href="#local-6989586621680847674"><span class="hs-identifier hs-var">tv</span></a></span></span><span> </span><span class="hs-special">[</span><span class="hs-special">]</span><span>     </span><span class="hs-special">[</span><span class="hs-special">]</span><span>         </span><span class="hs-glyph">=</span><span> </span><span class="hs-special">(</span><span class="hs-special">[</span><span class="annot"><span class="annottext">TyCoVar
</span><a href="#local-6989586621680847674"><span class="hs-identifier hs-var">tv</span></a></span><span class="hs-special">]</span><span class="hs-special">,</span><span> </span><span class="hs-special">[</span><span class="annot"><span class="annottext">Type -&gt; VarSet
</span><a href="GHC.Core.TyCo.FVs.html#tyCoVarsOfType"><span class="hs-identifier hs-var">tyCoVarsOfType</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">TyCoVar -&gt; Type
</span><a href="GHC.Types.Var.html#tyVarKind"><span class="hs-identifier hs-var">tyVarKind</span></a></span><span> </span><span class="annot"><span class="annottext">TyCoVar
</span><a href="#local-6989586621680847674"><span class="hs-identifier hs-var">tv</span></a></span><span class="hs-special">)</span><span class="hs-special">]</span><span class="hs-special">)</span><span>
</span><span id="line-972"></span><span>    </span><span class="annot"><a href="#local-6989586621680847675"><span class="hs-identifier hs-var">insert</span></a></span><span> </span><span id="local-6989586621680847673"><span class="annot"><span class="annottext">TyCoVar
</span><a href="#local-6989586621680847673"><span class="hs-identifier hs-var">tv</span></a></span></span><span> </span><span class="hs-special">(</span><span id="local-6989586621680847672"><span class="annot"><span class="annottext">TyCoVar
</span><a href="#local-6989586621680847672"><span class="hs-identifier hs-var">a</span></a></span></span><span class="annot"><span class="hs-glyph hs-type">:</span></span><span id="local-6989586621680847671"><span class="annot"><span class="annottext">[TyCoVar]
</span><a href="#local-6989586621680847671"><span class="hs-keyword hs-var">as</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-special">(</span><span id="local-6989586621680847670"><span class="annot"><span class="annottext">VarSet
</span><a href="#local-6989586621680847670"><span class="hs-identifier hs-var">fvs</span></a></span></span><span class="annot"><span class="hs-glyph hs-type">:</span></span><span id="local-6989586621680847669"><span class="annot"><span class="annottext">[VarSet]
</span><a href="#local-6989586621680847669"><span class="hs-identifier hs-var">fvss</span></a></span></span><span class="hs-special">)</span><span>
</span><span id="line-973"></span><span>      </span><span class="hs-glyph">|</span><span> </span><span class="annot"><span class="annottext">TyCoVar
</span><a href="#local-6989586621680847673"><span class="hs-identifier hs-var">tv</span></a></span><span> </span><span class="annot"><span class="annottext">TyCoVar -&gt; VarSet -&gt; Bool
</span><a href="GHC.Types.Var.Set.html#elemVarSet"><span class="hs-operator hs-var">`elemVarSet`</span></a></span><span> </span><span class="annot"><span class="annottext">VarSet
</span><a href="#local-6989586621680847670"><span class="hs-identifier hs-var">fvs</span></a></span><span>
</span><span id="line-974"></span><span>      </span><span class="hs-special">,</span><span> </span><span class="hs-special">(</span><span id="local-6989586621680847668"><span class="annot"><span class="annottext">[TyCoVar]
</span><a href="#local-6989586621680847668"><span class="hs-identifier hs-var">as'</span></a></span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621680847667"><span class="annot"><span class="annottext">[VarSet]
</span><a href="#local-6989586621680847667"><span class="hs-identifier hs-var">fvss'</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">TyCoVar -&gt; [TyCoVar] -&gt; [VarSet] -&gt; ([TyCoVar], [VarSet])
</span><a href="#local-6989586621680847675"><span class="hs-identifier hs-var">insert</span></a></span><span> </span><span class="annot"><span class="annottext">TyCoVar
</span><a href="#local-6989586621680847673"><span class="hs-identifier hs-var">tv</span></a></span><span> </span><span class="annot"><span class="annottext">[TyCoVar]
</span><a href="#local-6989586621680847671"><span class="hs-keyword hs-var">as</span></a></span><span> </span><span class="annot"><span class="annottext">[VarSet]
</span><a href="#local-6989586621680847669"><span class="hs-identifier hs-var">fvss</span></a></span><span>
</span><span id="line-975"></span><span>      </span><span class="hs-glyph">=</span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">TyCoVar
</span><a href="#local-6989586621680847672"><span class="hs-identifier hs-var">a</span></a></span><span class="annot"><span class="annottext">TyCoVar -&gt; [TyCoVar] -&gt; [TyCoVar]
forall a. a -&gt; [a] -&gt; [a]
</span><span class="hs-glyph hs-var">:</span></span><span class="annot"><span class="annottext">[TyCoVar]
</span><a href="#local-6989586621680847668"><span class="hs-identifier hs-var">as'</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">VarSet
</span><a href="#local-6989586621680847670"><span class="hs-identifier hs-var">fvs</span></a></span><span> </span><span class="annot"><span class="annottext">VarSet -&gt; VarSet -&gt; VarSet
</span><a href="GHC.Types.Var.Set.html#unionVarSet"><span class="hs-operator hs-var">`unionVarSet`</span></a></span><span> </span><span class="annot"><span class="annottext">VarSet
</span><a href="#local-6989586621680847665"><span class="hs-identifier hs-var">fv_tv</span></a></span><span> </span><span class="annot"><span class="annottext">VarSet -&gt; [VarSet] -&gt; [VarSet]
forall a. a -&gt; [a] -&gt; [a]
</span><span class="hs-glyph hs-var">:</span></span><span> </span><span class="annot"><span class="annottext">[VarSet]
</span><a href="#local-6989586621680847667"><span class="hs-identifier hs-var">fvss'</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-976"></span><span>
</span><span id="line-977"></span><span>      </span><span class="hs-glyph">|</span><span> </span><span class="annot"><span class="annottext">Bool
</span><a href="../../base/src/GHC.Base.html#otherwise"><span class="hs-identifier hs-var">otherwise</span></a></span><span>
</span><span id="line-978"></span><span>      </span><span class="hs-glyph">=</span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">TyCoVar
</span><a href="#local-6989586621680847673"><span class="hs-identifier hs-var">tv</span></a></span><span class="annot"><span class="annottext">TyCoVar -&gt; [TyCoVar] -&gt; [TyCoVar]
forall a. a -&gt; [a] -&gt; [a]
</span><span class="hs-glyph hs-var">:</span></span><span class="annot"><span class="annottext">TyCoVar
</span><a href="#local-6989586621680847672"><span class="hs-identifier hs-var">a</span></a></span><span class="annot"><span class="annottext">TyCoVar -&gt; [TyCoVar] -&gt; [TyCoVar]
forall a. a -&gt; [a] -&gt; [a]
</span><span class="hs-glyph hs-var">:</span></span><span class="annot"><span class="annottext">[TyCoVar]
</span><a href="#local-6989586621680847671"><span class="hs-keyword hs-var">as</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">VarSet
</span><a href="#local-6989586621680847670"><span class="hs-identifier hs-var">fvs</span></a></span><span> </span><span class="annot"><span class="annottext">VarSet -&gt; VarSet -&gt; VarSet
</span><a href="GHC.Types.Var.Set.html#unionVarSet"><span class="hs-operator hs-var">`unionVarSet`</span></a></span><span> </span><span class="annot"><span class="annottext">VarSet
</span><a href="#local-6989586621680847665"><span class="hs-identifier hs-var">fv_tv</span></a></span><span> </span><span class="annot"><span class="annottext">VarSet -&gt; [VarSet] -&gt; [VarSet]
forall a. a -&gt; [a] -&gt; [a]
</span><span class="hs-glyph hs-var">:</span></span><span> </span><span class="annot"><span class="annottext">VarSet
</span><a href="#local-6989586621680847670"><span class="hs-identifier hs-var">fvs</span></a></span><span> </span><span class="annot"><span class="annottext">VarSet -&gt; [VarSet] -&gt; [VarSet]
forall a. a -&gt; [a] -&gt; [a]
</span><span class="hs-glyph hs-var">:</span></span><span> </span><span class="annot"><span class="annottext">[VarSet]
</span><a href="#local-6989586621680847669"><span class="hs-identifier hs-var">fvss</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-979"></span><span>      </span><span class="hs-keyword">where</span><span>
</span><span id="line-980"></span><span>        </span><span id="local-6989586621680847665"><span class="annot"><span class="annottext">fv_tv :: VarSet
</span><a href="#local-6989586621680847665"><span class="hs-identifier hs-var hs-var">fv_tv</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Type -&gt; VarSet
</span><a href="GHC.Core.TyCo.FVs.html#tyCoVarsOfType"><span class="hs-identifier hs-var">tyCoVarsOfType</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">TyCoVar -&gt; Type
</span><a href="GHC.Types.Var.html#tyVarKind"><span class="hs-identifier hs-var">tyVarKind</span></a></span><span> </span><span class="annot"><span class="annottext">TyCoVar
</span><a href="#local-6989586621680847673"><span class="hs-identifier hs-var">tv</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-981"></span><span>
</span><span id="line-982"></span><span>       </span><span class="hs-comment">-- lists not in correspondence</span><span>
</span><span id="line-983"></span><span>    </span><span class="annot"><a href="#local-6989586621680847675"><span class="hs-identifier hs-var">insert</span></a></span><span> </span><span class="annot"><span class="annottext">TyCoVar
</span><span class="hs-identifier">_</span></span><span> </span><span class="annot"><span class="annottext">[TyCoVar]
</span><span class="hs-identifier">_</span></span><span> </span><span class="annot"><span class="annottext">[VarSet]
</span><span class="hs-identifier">_</span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">String -&gt; ([TyCoVar], [VarSet])
forall a. String -&gt; a
</span><a href="GHC.Utils.Panic.Plain.html#panic"><span class="hs-identifier hs-var">panic</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;scopedSort&quot;</span></span><span>
</span><span id="line-984"></span><span>
</span><span id="line-985"></span><span class="hs-comment">-- | Get the free vars of a type in scoped order</span><span>
</span><span id="line-986"></span><span class="annot"><a href="GHC.Core.TyCo.FVs.html#tyCoVarsOfTypeWellScoped"><span class="hs-identifier hs-type">tyCoVarsOfTypeWellScoped</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Core.TyCo.Rep.html#Type"><span class="hs-identifier hs-type">Type</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">[</span><span class="annot"><a href="GHC.Types.Var.html#TyVar"><span class="hs-identifier hs-type">TyVar</span></a></span><span class="hs-special">]</span><span>
</span><span id="line-987"></span><span id="tyCoVarsOfTypeWellScoped"><span class="annot"><span class="annottext">tyCoVarsOfTypeWellScoped :: Type -&gt; [TyCoVar]
</span><a href="GHC.Core.TyCo.FVs.html#tyCoVarsOfTypeWellScoped"><span class="hs-identifier hs-var hs-var">tyCoVarsOfTypeWellScoped</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">[TyCoVar] -&gt; [TyCoVar]
</span><a href="GHC.Core.TyCo.FVs.html#scopedSort"><span class="hs-identifier hs-var">scopedSort</span></a></span><span> </span><span class="annot"><span class="annottext">([TyCoVar] -&gt; [TyCoVar])
-&gt; (Type -&gt; [TyCoVar]) -&gt; Type -&gt; [TyCoVar]
forall b c a. (b -&gt; c) -&gt; (a -&gt; b) -&gt; a -&gt; c
</span><a href="../../base/src/GHC.Base.html#."><span class="hs-operator hs-var">.</span></a></span><span> </span><span class="annot"><span class="annottext">Type -&gt; [TyCoVar]
</span><a href="GHC.Core.TyCo.FVs.html#tyCoVarsOfTypeList"><span class="hs-identifier hs-var">tyCoVarsOfTypeList</span></a></span><span>
</span><span id="line-988"></span><span>
</span><span id="line-989"></span><span class="hs-comment">-- | Get the free vars of types in scoped order</span><span>
</span><span id="line-990"></span><span class="annot"><a href="GHC.Core.TyCo.FVs.html#tyCoVarsOfTypesWellScoped"><span class="hs-identifier hs-type">tyCoVarsOfTypesWellScoped</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="hs-special">[</span><span class="annot"><a href="GHC.Core.TyCo.Rep.html#Type"><span class="hs-identifier hs-type">Type</span></a></span><span class="hs-special">]</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">[</span><span class="annot"><a href="GHC.Types.Var.html#TyVar"><span class="hs-identifier hs-type">TyVar</span></a></span><span class="hs-special">]</span><span>
</span><span id="line-991"></span><span id="tyCoVarsOfTypesWellScoped"><span class="annot"><span class="annottext">tyCoVarsOfTypesWellScoped :: [Type] -&gt; [TyCoVar]
</span><a href="GHC.Core.TyCo.FVs.html#tyCoVarsOfTypesWellScoped"><span class="hs-identifier hs-var hs-var">tyCoVarsOfTypesWellScoped</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">[TyCoVar] -&gt; [TyCoVar]
</span><a href="GHC.Core.TyCo.FVs.html#scopedSort"><span class="hs-identifier hs-var">scopedSort</span></a></span><span> </span><span class="annot"><span class="annottext">([TyCoVar] -&gt; [TyCoVar])
-&gt; ([Type] -&gt; [TyCoVar]) -&gt; [Type] -&gt; [TyCoVar]
forall b c a. (b -&gt; c) -&gt; (a -&gt; b) -&gt; a -&gt; c
</span><a href="../../base/src/GHC.Base.html#."><span class="hs-operator hs-var">.</span></a></span><span> </span><span class="annot"><span class="annottext">[Type] -&gt; [TyCoVar]
</span><a href="GHC.Core.TyCo.FVs.html#tyCoVarsOfTypesList"><span class="hs-identifier hs-var">tyCoVarsOfTypesList</span></a></span><span>
</span><span id="line-992"></span><span>
</span><span id="line-993"></span></pre></body></html>